After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609622 - disappearing statusicon
disappearing statusicon
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkStatusIcon
2.16.x
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2010-02-11 08:15 UTC by Yann Leboulanger
Modified: 2010-12-29 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (663 bytes, text/x-python)
2010-02-11 08:15 UTC, Yann Leboulanger
  Details
Status icon visibility persistence for win7 (828 bytes, patch)
2010-10-30 16:10 UTC, Hans Breuer
none Details | Review

Description Yann Leboulanger 2010-02-11 08:15:10 UTC
Created attachment 153509 [details]
test case

Under windows seven (and probably windows server) gtk.statusicon
gets hidden from systray. Even if we ask Windows to keep it in systay, it
stays visible .... until we restart the program. Is there something I did badly?

I attach a small testcase.

Start it, syatusicon gets hidden, ask window to always show it, restart the program -> icon gets hidden.
Comment 1 Gian Mario Tagliaretti 2010-02-15 13:04:04 UTC
It cannot be PyGTK, redirecting to GTK+ win32
Comment 2 viktor 2010-10-21 18:31:20 UTC
isn't this confirmed at all?

this buggy behaviour exists ever since the first beta of win7 (2 years ago). any app using gtkstatusicon will lose notification area preferences upon exit, which is horrible.

emesene, xchat-wdk, claws-mail, anything. pidgin can only make its icon stick coz it uses custom code (600 lines) instead of the general gtkstatusicon code (100 lines).

please, please do something about this.
Comment 3 Hans Breuer 2010-10-30 14:18:57 UTC
This is not a matter of compalining louder, but of ideas how to fix it. At first glance the information from MSDN does not look very promising:

"""
If your application is intended to run on both Windows Vista and Windows 7, it is imperative that you check the version of Windows and only specify a non-zero guidItem if on Windows 7 or later.
""" 
http://msdn.microsoft.com/en-us/library/bb773352%28v=VS.85%29.aspx

It is only my guess, that status icon visibility persistence has something to with NOTIFYICONDATA::guidItem, but:
 - Gtk+ is not an application and I guess the guid should be application specific
 - Gtk+ is supposed to run on versions before Windows 7 (even XP!)

If another toolkit free software toolkit has found a solution, please tell us.
Even a link to the "600 lines" of pidgin might help, but at least I'm not installing Monotone and what not to have a look.

BTW: at least the pre-release version had a checkbox "Always show all icons and notifications on the taskbar". That should for Gtk+ status icons as well.
Comment 4 viktor 2010-10-30 14:46:59 UTC
here's a sample (Notification Icon Sample):

http://code.msdn.microsoft.com/shellintegration

pidgin sources (v2.7.4):

http://developer.pidgin.im/viewmtn/revision/file/2872bcba5019558c0d77e8cf9b43801167e5efc8/pidgin/gtkdocklet-gtk.c

http://developer.pidgin.im/viewmtn/revision/file/2872bcba5019558c0d77e8cf9b43801167e5efc8/pidgin/win32/gtkdocklet-win32.c

distinguishing win7 from others is quite easy:

http://msdn.microsoft.com/en-us/library/ms724833%28VS.85%29.aspx

there is "Always show all icons and notifications on the taskbar", but somehow i don't feel like having 20 icons on my taskbar all the time...
Comment 5 viktor 2010-10-30 14:57:40 UTC
another sample which doesn't set guiditem, yet it sticks to the taskbar after app restart (sdTray.cpp in particular):

http://code.google.com/p/xchat-wdk/source/browse/plugins/xtray/
Comment 6 viktor 2010-10-30 15:04:44 UTC
a sample for windows version check:

http://code.google.com/p/xchat-wdk/source/detail?r=0a6e1ce396cf8e52b141a239e7e993ea0e140357

no separate file, just a diff, sorry.
Comment 7 Hans Breuer 2010-10-30 16:10:59 UTC
Created attachment 173558 [details] [review]
Status icon visibility persistence for win7 

Thanks, now the remaining question is why all those people thought they have to oimplement an application specific solution when Gtk+ only needed a ten line patch. (I have only briefly tested this in a virtual machine with win7 RC)
Comment 8 viktor 2010-10-30 17:12:01 UTC
great, thank you very much. any chance for this to be committed to 2-22 before 2.22.1 is tagged?
Comment 9 Hans Breuer 2010-11-07 23:00:46 UTC
Pushed to gtk-2-16, gtk-2-22, gtk-2-24 and master branch.
Comment 10 viktor 2010-11-07 23:02:21 UTC
many thanks, Hans. can't wait to test it :)
Comment 11 Jim Duchek 2010-11-21 01:28:38 UTC
The attached fix will have problems with applications that may create multiple status icons.  Not sure there's an easy way to fix this.
Comment 12 viktor 2010-12-29 11:00:32 UTC
now i can confirm this indeed works (i tested with the xchat tray icon, it has only one icon) with the new 32 bit gtk 2.22.1 builds.

can't wait for the 64 bit builds to be released as well :)