Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 168480

Summary: mail-client/sylpheed-2.3.0 displays an unwanted, empty tray icon
Product: Gentoo Linux Reporter: Maarten Bressers (RETIRED) <mbres>
Component: Current packagesAssignee: Akinori Hattori <hattya>
Status: RESOLVED FIXED    
Severity: trivial CC: net-mail+disabled
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Maarten Bressers (RETIRED) gentoo-dev 2007-02-26 17:26:05 UTC
mail-client/sylpheed-2.3.0 displays an empty tray icon in the system tray, even when option "Display tray icon" is _not_ selected under Configuration/Common Preferences/Details (== "show_trayicon=0" in sylpheedrc)

Reproducible: Always

Steps to Reproduce:
1. make sure you've opted to _not_ display the tray icon
2. run sylpheed
3. watch an empty tray icon appear

Actual Results:  
An unwanted, empty tray icon appears

Expected Results:  
No tray icon should appear

These two patches fix it for me: 

-----8<-----
--- ../../sylpheed-2.3.0/src/mainwindow.c       2007-02-25 20:42:43.000000000 +0100
+++ mainwindow.c        2007-02-26 17:56:33.000000000 +0100
@@ -979,7 +979,10 @@

        gtk_widget_show_all(statusbar);

-       tray_icon = trayicon_create(mainwin);
+       if (prefs_common.show_trayicon)
+               tray_icon = trayicon_create(mainwin);
+       else
+               tray_icon = NULL;
        if (tray_icon && prefs_common.show_trayicon)
                trayicon_show(tray_icon);
-----8<-----
--- ../../sylpheed-2.3.0/src/trayicon.c 2007-02-25 21:02:51.000000000 +0100
+++ trayicon.c  2007-02-26 17:56:36.000000000 +0100
@@ -183,8 +183,10 @@

 void trayicon_destroy(TrayIcon *tray_icon)
 {
-       g_object_unref(tray_icon->status_icon);
-       tray_icon->status_icon = NULL;
+       if (tray_icon) {
+               g_object_unref(tray_icon->status_icon);
+               tray_icon->status_icon = NULL;
+       }
 }

 void trayicon_set_tooltip(const gchar *text)
-----8<-----

I have only tested this with GTK 2.10.6 (x11-libs/gtk+-2.10.6, stable), and not with GTK versions < 2.10.

The patches also apply cleanly to version 2.3.1 (~x86) which shows the same behavior (ie. unwanted tray icon).
Comment 1 Akinori Hattori gentoo-dev 2007-05-06 11:02:14 UTC
2.3.x are removed. If you have same behavior with 2.4.x, please submit new bug for it.