mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
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.
This commit is contained in:
parent
cf4c46ff0b
commit
a13c566736
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user