summaryrefslogtreecommitdiffstats
path: root/gentoo/dev-qt/qt/files/trinity-3.5.13.1..3.5.13.2/qt3-2013-05-03_03_47_45-Fix-corrupted-titlebar-icons-in-subwindows-of-ARGB-applications-90f4a55.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gentoo/dev-qt/qt/files/trinity-3.5.13.1..3.5.13.2/qt3-2013-05-03_03_47_45-Fix-corrupted-titlebar-icons-in-subwindows-of-ARGB-applications-90f4a55.patch')
m---------gentoo0
-rw-r--r--gentoo/dev-qt/qt/files/trinity-3.5.13.1..3.5.13.2/qt3-2013-05-03_03_47_45-Fix-corrupted-titlebar-icons-in-subwindows-of-ARGB-applications-90f4a55.patch63
2 files changed, 0 insertions, 63 deletions
diff --git a/gentoo b/gentoo
new file mode 160000
+Subproject 644110a847c5911c2eb04eb53c93031740561ef
diff --git a/gentoo/dev-qt/qt/files/trinity-3.5.13.1..3.5.13.2/qt3-2013-05-03_03_47_45-Fix-corrupted-titlebar-icons-in-subwindows-of-ARGB-applications-90f4a55.patch b/gentoo/dev-qt/qt/files/trinity-3.5.13.1..3.5.13.2/qt3-2013-05-03_03_47_45-Fix-corrupted-titlebar-icons-in-subwindows-of-ARGB-applications-90f4a55.patch
deleted file mode 100644
index 437dca94c..000000000
--- a/gentoo/dev-qt/qt/files/trinity-3.5.13.1..3.5.13.2/qt3-2013-05-03_03_47_45-Fix-corrupted-titlebar-icons-in-subwindows-of-ARGB-applications-90f4a55.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff --git a/src/kernel/qwidget_x11.cpp b/src/kernel/qwidget_x11.cpp
-index a095025..783034e 100644
---- a/src/kernel/qwidget_x11.cpp
-+++ b/src/kernel/qwidget_x11.cpp
-@@ -44,6 +44,7 @@
- #include "qpaintdevicemetrics.h"
- #include "qpainter.h"
- #include "qbitmap.h"
-+#include "qimage.h"
- #include "qobjectlist.h"
- #include "qlayout.h"
- #include "qtextcodec.h"
-@@ -1231,14 +1232,47 @@ void QWidget::setIcon( const QPixmap &pixmap )
- }
- Pixmap icon_pixmap = 0;
- Pixmap mask_pixmap = 0;
-+ QPixmap* pm = NULL;
- if ( !pixmap.isNull() ) {
-- QPixmap* pm = new QPixmap( pixmap );
-+ if (pixmap.depth() == 24) {
-+ pm = new QPixmap( pixmap );
-+ }
-+ else {
-+ // With most window managers, only 24-bit icon pixmaps are allowed in the WM hints, otherwise corrupt icons will be displayed
-+ // Convert provided pixmaps to 24-bit here
-+ int w = pixmap.width();
-+ int h = pixmap.height();
-+ pm = new QPixmap( pixmap.width(), pixmap.height(), 24 );
-+ QImage iconImage = pixmap.convertToImage();
-+
-+ // Load the new 24-bit RGB pixmap with data
-+ GC gc;
-+ pm->detach();
-+ Qt::HANDLE pmHandle = pm->handle();
-+ gc = XCreateGC(x11Display(), pmHandle, 0, 0);
-+ for (int y = 0; y < h; ++y) {
-+ QRgb *ls = (QRgb *)iconImage.scanLine( y );
-+ for (int x = 0; x < w; ++x) {
-+ QRgb l = ls[x];
-+ int r = int( qRed( l ) );
-+ int g = int( qGreen( l ) );
-+ int b = int( qBlue( l ) );
-+ ls[x] = qRgb( r, g, b );
-+ XSetForeground(x11Display(), gc, (r << 16) | (g << 8) | b );
-+ XDrawPoint(x11Display(), pmHandle, gc, x, y);
-+ }
-+ }
-+ XFreeGC(x11Display(), gc);
-+ }
-+
- extra->topextra->icon = pm;
-- if ( !pm->mask() )
-+ if ( !pm->mask() ) {
- pm->setMask( pm->createHeuristicMask() ); // may do detach()
-+ }
- icon_pixmap = pm->handle();
-- if ( pm->mask() )
-+ if ( pm->mask() ) {
- mask_pixmap = pm->mask()->handle();
-+ }
- }
- XWMHints *h = XGetWMHints( x11Display(), winId() );
- XWMHints wm_hints;