From 05993b821063a9eda866b8eed024231de008b018 Mon Sep 17 00:00:00 2001 From: scorpion-26 Date: Thu, 2 May 2024 11:22:15 +0200 Subject: [PATCH] SNI: Fix icon reloading for raw pixmaps --- src/SNI.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SNI.cpp b/src/SNI.cpp index 05ac880..a015ea0 100644 --- a/src/SNI.cpp +++ b/src/SNI.cpp @@ -226,6 +226,7 @@ namespace SNI g_variant_unref(iconNameVar); } } + bool gotPixbuf = false; if (iconName != "") { GdkPixbuf* pixbuf = nullptr; @@ -258,11 +259,13 @@ namespace SNI data->item.pixbuf = pixbuf; data->item.w = gdk_pixbuf_get_width(pixbuf); data->item.h = gdk_pixbuf_get_height(pixbuf); + gotPixbuf = true; } } - if (data->item.pixbuf == nullptr) + if (!gotPixbuf) { + // IconName failed to load, try IconPixmap as a fallback GVariant* iconPixmap = getProperty("IconPixmap"); if (iconPixmap == nullptr) {