Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(systemtrayicon): don't set an invalid and useless icon on GTK
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
b4n committed Jun 14, 2016
1 parent cf4c46f commit a13c566
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/widget/systemtrayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit a13c566

Please sign in to comment.