summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-05-03 15:02:25 -0500
committerSlávek Banko <slavek.banko@axis.cz>2013-05-04 17:28:30 +0200
commitd2240de110fbd429843355d10bf712906c026405 (patch)
tree98d987a753f8166a8205e3bf729a8ec8f6c3a669
parent90f4a5524ce3772f0c921644ee6aa71e09dafb3d (diff)
downloadqt3-d2240de110fbd429843355d10bf712906c026405.tar.gz
qt3-d2240de110fbd429843355d10bf712906c026405.zip
Fix ARGB mode stippled focus rectangle showing underlying window contents
Fix TQColor not processing alpha channel in ARGB mode (cherry picked from commit 2a85fcbb5cafc25a750ce548123c8e7422793b3c)
-rw-r--r--src/kernel/qcolor_x11.cpp8
-rw-r--r--src/kernel/qpainter_x11.cpp19
2 files changed, 21 insertions, 6 deletions
diff --git a/src/kernel/qcolor_x11.cpp b/src/kernel/qcolor_x11.cpp
index eeaee5e..dbd039e 100644
--- a/src/kernel/qcolor_x11.cpp
+++ b/src/kernel/qcolor_x11.cpp
@@ -407,8 +407,14 @@ uint QColor::alloc( int screen )
b = sd->blue_shift > 0 ? b << sd->blue_shift : b >> -sd->blue_shift;
pix = (b & sd->blue_mask) | (g & sd->green_mask) | (r & sd->red_mask)
| ~(sd->blue_mask | sd->green_mask | sd->red_mask);
- if ( screen == QPaintDevice::x11AppScreen() )
+ if (QPaintDevice::x11AppDepth(screen) == 32) {
+ int a = qAlpha(d.argb);
+ pix = pix & 0x00ffffff;
+ pix = pix | (a << 24);
+ }
+ if ( screen == QPaintDevice::x11AppScreen() ) {
d.d32.pix = pix;
+ }
return pix;
}
QColorData *c = sd->colorDict->find( (long)(d.argb) );
diff --git a/src/kernel/qpainter_x11.cpp b/src/kernel/qpainter_x11.cpp
index 126c0d6..267887e 100644
--- a/src/kernel/qpainter_x11.cpp
+++ b/src/kernel/qpainter_x11.cpp
@@ -1842,16 +1842,24 @@ void QPainter::drawWinFocusRect( int x, int y, int w, int h,
RasterOp old_rop = (RasterOp)rop;
if ( xorPaint ) {
- if ( QColor::numBitPlanes() <= 8 )
+ if ( QColor::numBitPlanes() <= 8 ) {
setPen( QPen(color1, 0, Qt::FineDotLine) );
- else
+ }
+ else if ( QColor::numBitPlanes() <= 8 ) {
setPen( QPen(white, 0, Qt::FineDotLine) );
+ }
+ else {
+ setPen( QPen(QColor(qRgba(255,255,255,0)), 0, Qt::FineDotLine) );
+ }
setRasterOp( XorROP );
- } else {
- if ( qGray( bgColor.rgb() ) < 128 )
+ }
+ else {
+ if ( qGray( bgColor.rgb() ) < 128 ) {
setPen( QPen(white, 0, Qt::FineDotLine) );
- else
+ }
+ else {
setPen( QPen(black, 0, Qt::FineDotLine) );
+ }
}
if ( testf(ExtDev|VxF|WxF) ) {
@@ -1876,6 +1884,7 @@ void QPainter::drawWinFocusRect( int x, int y, int w, int h,
XSetLineAttributes( dpy, gc, 1, LineOnOffDash, CapButt, JoinMiter );
XDrawRectangle( dpy, hd, gc, x, y, w-1, h-1 );
+
XSetLineAttributes( dpy, gc, 0, LineSolid, CapButt, JoinMiter );
setRasterOp( old_rop );
setPen( old_pen );