diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-27 07:46:59 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-27 07:46:59 +0000 |
commit | 7a65dcc2ed6360280f8072a8e210c3a5fa313d34 (patch) | |
tree | 944f635f9cbe2d0c351433cb27b19ad68704be3b /kdeui | |
parent | 2944cdf050c47b9a048b7f0d19741fac23aa77c3 (diff) | |
download | tdelibs-7a65dcc2ed6360280f8072a8e210c3a5fa313d34.tar.gz tdelibs-7a65dcc2ed6360280f8072a8e210c3a5fa313d34.zip |
Fix up the system tray to handle embedded windows with a different X11 depth than the tray itself
This truly and finally fixes system tray icon transparency when the parent application uses ARGB visuals
Part 1/2
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1249644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui')
-rw-r--r-- | kdeui/ksystemtray.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/kdeui/ksystemtray.cpp b/kdeui/ksystemtray.cpp index c1cea624a..e354b95a2 100644 --- a/kdeui/ksystemtray.cpp +++ b/kdeui/ksystemtray.cpp @@ -329,31 +329,8 @@ void KSystemTray::setPixmap( const TQPixmap& p ) { TQPixmap iconPixmapToSet = p; if (TQPaintDevice::x11AppDepth() == 32) { - // Since full ARGB visuals are in use, we must handle the three primary data - // channel types (color, alpha, and mask) separately. - // First, make the actual color and internal alpha of the icon is correct TQImage correctedImage = KImageEffect::convertToPremultipliedAlpha( iconPixmapToSet.convertToImage() ); iconPixmapToSet.convertFromImage(correctedImage); - // Next, handle the mask channel to make sure that the transparent - // sections remain transparent when drawn on the screen - TQBitmap maskBitmap; - // Generate the mask utilizing ONLY the pixels that are fully opaque - TQImage newMaskImage = correctedImage; - int w = newMaskImage.width(); - int h = newMaskImage.height(); - for (int y = 0; y < h; ++y) { - TQRgb *ls = (TQRgb *)newMaskImage.scanLine( y ); - for (int x = 0; x < w; ++x) { - TQRgb l = ls[x]; - int r = int( tqRed( l ) ); - int g = int( tqGreen( l ) ); - int b = int( tqBlue( l ) ); - int a = int( (tqAlpha( l ) == 255) ? 255 : 0 ); - ls[x] = tqRgba( r, g, b, a ); - } - } - maskBitmap.convertFromImage(newMaskImage.createAlphaMask()); - setMask(maskBitmap); } TQLabel::setPixmap( iconPixmapToSet ); #ifdef Q_WS_X11 |