gnome-power-manager and gnome session icon bug

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.

Published by

hughsie

Richard has over 10 years of experience developing open source software. He is the maintainer of GNOME Software, PackageKit, GNOME Packagekit, GNOME Power Manager, GNOME Color Manager, colord, and UPower and also contributes to many other projects and opensource standards. Richard has three main areas of interest on the free desktop, color management, package management, and power management. Richard graduated a few years ago from the University of Surrey with a Masters in Electronics Engineering. He now works for Red Hat in the desktop group, and also manages a company selling open source calibration equipment. Richard's outside interests include taking photos and eating good food.

6 thoughts on “gnome-power-manager and gnome session icon bug”

  1. 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.

  2. Isn’t it because the notification area applet is loaded after the power manager status icon? Probably a bug in the notification area applet?

  3. 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.

Comments are closed.