From 55d78698c2d40f7a4d65d6fdf7998871dc0bf4e7 Mon Sep 17 00:00:00 2001 From: tux3 Date: Sun, 22 Feb 2015 00:56:20 +0100 Subject: [PATCH] Fix statusnotifier icon color conversion We were passing premultiplied ARGB data to GTK, where it expected premultiplied RGBA --- src/widget/systemtrayicon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/widget/systemtrayicon.cpp b/src/widget/systemtrayicon.cpp index c66a25e17..fbd61cd90 100644 --- a/src/widget/systemtrayicon.cpp +++ b/src/widget/systemtrayicon.cpp @@ -120,8 +120,8 @@ void SystemTrayIcon::setContextMenu(QMenu* menu) delete reinterpret_cast(image); }; QImage* image = new QImage(a->icon().pixmap(64, 64).toImage()); - if (image->format() != QImage::Format_ARGB32_Premultiplied) - *image = image->convertToFormat(QImage::Format_ARGB32_Premultiplied); + if (image->format() != QImage::Format_RGBA8888_Premultiplied) + *image = image->convertToFormat(QImage::Format_RGBA8888_Premultiplied); GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(image->bits(), GDK_COLORSPACE_RGB, image->hasAlphaChannel(), 8, image->width(), image->height(), image->bytesPerLine(), callbackFreeImage, image); @@ -244,8 +244,8 @@ void SystemTrayIcon::setIcon(QIcon &&icon) delete reinterpret_cast(image); }; QImage* image = new QImage(icon.pixmap(64, 64).toImage()); - if (image->format() != QImage::Format_ARGB32_Premultiplied) - *image = image->convertToFormat(QImage::Format_ARGB32_Premultiplied); + if (image->format() != QImage::Format_RGBA8888_Premultiplied) + *image = image->convertToFormat(QImage::Format_RGBA8888_Premultiplied); GdkPixbuf* pixbuf = gdk_pixbuf_new_from_data(image->bits(), GDK_COLORSPACE_RGB, image->hasAlphaChannel(), 8, image->width(), image->height(), image->bytesPerLine(), callbackFreeImage, image);