gnome-power-manager shows a GtkStatusIcon of the battery state. When gnome-power-manager is launched from gnome-session at login time, the icon is not shown on the panel, even though the icon name is set and it’s set visible. It isn’t shown even doing by setting the filename icon again and doing gtk_status_icon_set_visible() several seconds after starting. gtk_status_icon_is_embedded() is always false.
If I do “killall gnome-power-manager”, gnome-session respawns the binary (because of X-GNOME-AutoRestart) and the icon shows correctly. It also starts correctly if you launch it manually from gnome-terminal.
Even if I remove the X-GNOME-Autostart-Phase=Panel (so that it starts as an application, well after the panel is formed) it still doesn’t show.
If you’ve got any tips on how to debug this I would appreciate it. I’m out of ideas. Thanks.
Whilst debugging this I’ve found, when I remove the notification area applet:
Gtk-Message: GtkPlug: ReparentNotify received
Gtk-Message: GtkPlug: end of embedding
Gtk-Message: GtkPlug: calling gtk_plug_send_delete_event()
GtkStatusIcon 0x89df810: delete notify, tray manager window 3600003
GtkStatusIcon 0x89df810: realized, window: 180002c, socket window: 0
GtkStatusIcon 0x89df810: sending dock request to manager window 3600003
GtkStatusIcon 0x89df810: got other message on manager window
GtkStatusIcon 0x89df810: got DestroyNotify for manager window
GtkStatusIcon 0x89df810: tray manager window destroyed
When I add back the notification area applet I don’t get “tray manager appeared” nor any notify::embedded signals from the GtkStatusIcon, and thus no icon shows for g-p-m.
You can reproduce with a running instance with:
killall gnome-panel && gnome-power-manager –verbose && gnome-panel
According to hadess, this also affects the PulseAudio volume control too.
Isn’t it because the notification area applet is loaded after the power manager status icon? Probably a bug in the notification area applet?
Please don’t start it in phase Panel or that will delay the entire login sequence.
FIXED: Some new idletime code was doing XSelectInput(XSyncAlarmNotifyMask) which filtered out the reparent. This is why it worked when unit testing and on a a new startup, but not before the notification area was setup. Should be fixed in trunk.
Richard, as Behdad commented, you shouldn’t start g-p-m on panel phase (bug #571330).