GNOME Bugzilla – Bug 609622
disappearing statusicon
Last modified: 2010-12-29 11:00:32 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.
It cannot be PyGTK, redirecting to GTK+ win32
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.
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.
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...
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/
a sample for windows version check: http://code.google.com/p/xchat-wdk/source/detail?r=0a6e1ce396cf8e52b141a239e7e993ea0e140357 no separate file, just a diff, sorry.
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)
great, thank you very much. any chance for this to be committed to 2-22 before 2.22.1 is tagged?
Pushed to gtk-2-16, gtk-2-22, gtk-2-24 and master branch.
many thanks, Hans. can't wait to test it :)
The attached fix will have problems with applications that may create multiple status icons. Not sure there's an easy way to fix this.
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 :)