GNOME Bugzilla – Bug 340110
invisible status icon takes up space
Last modified: 2011-06-01 05:44:09 UTC
When setting a status icon to invisible, it still takes 1 or 2 px in the notification area, which looks ugly. Maybe it should de-embed itself in this case? Steps to reproduce: 0) Apply attached patch to teststatusicon 1) Right-click the status icon, Properties... 2) Set "visible" property to false
Created attachment 64518 [details] add property editor to teststatusicon
Created attachment 78795 [details] [review] proposed patch This patch fixes this bug, by making the tray icon unrealized instead of just hidden when the status icon is set to invisible. This approach also fixes all of the following problems I noticed while playing around with testtray and teststatusicon: - icons on screens != default wouldn't dock correctly (missing setting the manager window to None in unrealize) - when redocking succeeded, sometimes the icon would have the wrong dimensions (just 1px wide) - when the tray exited uncleanly (crash), the icon would show in a toplevel of its own (mentioned in bug 160132 comment 25).
so, this has 2 flaws: 1) It seems to miss some notification for the new embedded property on the statusicon. If I toggle the visibility of the statusicon with this patch, I get "embedded changed to 1" when making it visible, but no "embedded changed to 0" when hiding it. 2) More seriously, this makes icons rearrange in the tray as they become visible and invisible, which is confusing. Just try it, run two instances of teststatusicon, make them show different images, then toggle the visibility of the right one. It will jump to the left. Msybe we can avoid that by just unmapping instead of unrealizing.
1) was a bug in GtkPlug, I have a patch that I filed in bug 388738. I don't think 2) is a bug at all. When the notification disappears (whether removed altogether or just set to invisible) and then another appears (whether a new one or just the old one set visible), it's a new notification for the user, and the tray will add it to whererever new ones are added. Just unmapping the widget won't work since the current code gtk_widget_hide()s the tray and hiding does an unmap already.
(sorry, I unintentionally changed the patch status, resetting)
2007-01-27 Matthias Clasen <mclasen@redhat.com> * gtk/gtkstatusicon.c: * gtk/gtktrayicon-x11.c: Fix GtkStatusIcon to not take up space on the panel if it is invisible. (340110, Christian Persch) * tests/teststatusicon.c: * tests/Makefile.am: Updates
*** Bug 404558 has been marked as a duplicate of this bug. ***
Is this going to be backported to 2.10, or will it stay in Trunk?
Reopening
Still experiencing this in Gutsy. GTK 2.11.6
Alex: I can't reproduce this with gtk svn. Are you sure the status icons of the programmes you see this with are actually using gtkstatusicon?
import gtk s = {} for i in range(0, 100): s[i] = gtk.status_icon_new_from_icon_name("sound") s[i].set_visible(False) gtk.main() It's even worse now than it was before, because the space is no longer freed even when the program exits.
I can see the bug with your test programme, but I cannot see it in teststatusicon when switching visibility on/off using the prop editor.
Try running 100 prop editors and turning their visibilities off. (Ubuntu seems to want to have, at any one time, like 3 or 4 hidden status icons for various things like power manager, update manager. However, even just ONE hidden status icon taking up 1 pixel is still a bug.)
I can confirm for GNOME gnome-panel 2.20.1 (Ubuntu 7.10 Gutsy, updated) See screenshot: http://agafonov.pp.ru/bugz/notifyarea.png
Indeed, this is still affecting GNOME 2.21 (Ubuntu 8.04 Hardy). The test case in Comment #12 creates loads of space and doesn't free it after it closes, still.
If it doesn't free it after close, it has to be a panel bug.
Right. But it's still creating the space in the first place :)
Still a panel bug, I'd say
*** Bug 591189 has been marked as a duplicate of this bug. ***
Just noticed this is the origin of a bug in epiphany, our download notification icon leaves 'blank space'. I have no clue if this is GTK+ or the panel applet, but the 'solution' for me was to call gtk_status_icon_set_visible (icon, FALSE). I would blame Vincent. Any idea? :^)
That would probably be bug 589860, where I attached a test case. Apparently, the notification area never receives the right signal.
(In reply to comment #16) > Indeed, this is still affecting GNOME 2.21 (Ubuntu 8.04 Hardy). The test case > in Comment #12 creates loads of space and doesn't free it after it closes, > still. I tried it on pygtk 2.15.2, the space is allocated on new (black vertical bar) but removed on set_visible(False) so it just makes the black bar blink and things move until it finishes the loop, so the original bug looks fixed now: invisible icons do not take space
I believe this was fixed in gnome-panel tray implementation for 3.0