From a13c566736b11880e43fe3af870b521175aeabe7 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Tue, 14 Jun 2016 01:15:48 +0200 Subject: [PATCH] fix(systemtrayicon): don't set an invalid and useless icon on GTK * The initial status icon to set on GTK didn't exist (anymore?). * GTK resources aren't compatible with Qt's, so the resource lookup couldn't work anyway, even if it did exist. * The caller calls SystemTryIcon::setIcon() right after instancing it anyway, so there's no need for an initial icon. This fixes a runtime critical warning from GTK as we tried to unref a NULL icon, which is invalid. Fixes #3154. --- src/widget/systemtrayicon.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/widget/systemtrayicon.cpp b/src/widget/systemtrayicon.cpp index 2bd5acf9c..190a41dfe 100644 --- a/src/widget/systemtrayicon.cpp +++ b/src/widget/systemtrayicon.cpp @@ -66,10 +66,7 @@ SystemTrayIcon::SystemTrayIcon() backendType = SystrayBackendType::GTK; gtk_init(nullptr, nullptr); - // No ':' needed in resource path! - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_resource("/img/icon.png", NULL); - gtkIcon = gtk_status_icon_new_from_pixbuf(pixbuf); - g_object_unref(pixbuf); + gtkIcon = gtk_status_icon_new(); gtkMenu = gtk_menu_new();