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 375377 - gnome-power-manager does not reattach to the notification area after gnome-panel has crashed or has been killed
gnome-power-manager does not reattach to the notification area after gnome-pa...
Status: RESOLVED FIXED
Product: gnome-power-manager
Classification: Deprecated
Component: gnome-power-manager
2.16.x
Other All
: Normal minor
: ---
Assigned To: GNOME Power Manager Maintainer(s)
GNOME Power Manager Maintainer(s)
: 380872 448061 (view as bug list)
Depends on: 382178
Blocks:
 
 
Reported: 2006-11-15 02:03 UTC by Alan
Modified: 2007-06-17 23:21 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Screenshot (129.25 KB, image/png)
2006-11-19 01:54 UTC, Alan
Details

Description Alan 2006-11-15 02:03:30 UTC
Please describe the problem:
This has happened to me twice. I'll either kill gnome-panel, or it crashes on me, and the notification area icon for gnome-power-manager does not reattach to the notification area when gnome-panel restarts. 

Steps to reproduce:
0. Make sure gnome-power-manager is displaying a notification icon
1. $killall gnome-panel
2. observe as the notification icon stays in its own window


Actual results:
gnome-panel is killed, the notification icon for g-p-m pops out into its own window (good), gnome-panel restarts, notification icon for g-p-m stays in its own window.

Expected results:
the icon should go back where it was in the notification area.

Does this happen every time?
Yes

Other information:
Comment 1 Richard Hughes 2006-11-15 08:59:05 UTC
Any idea how to fix this? Thanks.
Comment 2 Alan 2006-11-16 00:51:46 UTC
I wouldn't have any idea (not a developer in any way) but I know that gaim and skype at the least are capable of this. You probably can't ask skype how they do it, but gaim should be accessible. 
Comment 3 Richard Hughes 2006-11-18 09:52:58 UTC
I can't reproduce - what disto and versions are you running?
Comment 4 Alan 2006-11-19 01:54:13 UTC
Created attachment 76822 [details]
Screenshot

Here's a screenshot. I'm running Ubuntu 6.10 Edgy Eft, Gnome 2.16.1.
Comment 5 Alan 2006-11-19 04:04:10 UTC
Incidentally, Gaim and Skype re-attach, but nm-applet and the OpenOffice quickstarter both disappear.
Comment 6 Pascal Terjan 2006-12-03 21:01:51 UTC
*** Bug 380872 has been marked as a duplicate of this bug. ***
Comment 7 Pascal Terjan 2006-12-03 21:03:31 UTC
gaim, lifera and rhythmbox come back fine so their code could help :)
Comment 8 Pascal Terjan 2006-12-03 21:20:58 UTC
In liferea, they destroy it and use g_idle_add to recreate it :

static void ui_tray_destroyed_cb(GtkWidget *widget, void *data) {

        g_object_unref(G_OBJECT(tray_icon));

        image = NULL;
        tray_icon = NULL;
        trayCount--;
        ui_mainwindow_tray_remove();

        /* And make it re-appear when the notification area reappears */
        g_idle_add(ui_tray_create_cb, NULL);
}

In rhythmbox they also re-create it :

static gboolean
tray_destroy_cb (GtkObject *object,
                 RBShell *shell)
{
        if (shell->priv->tray_icon) {
                rb_debug ("caught destroy event for tray icon %p", object);
                gtk_object_sink (object);
                shell->priv->tray_icon = NULL;
                rb_debug ("finished sinking tray");
        }

        rb_debug ("creating new tray icon");
        shell->priv->tray_icon = rb_tray_icon_new (shell->priv->ui_manager, shell);
        g_signal_connect_object (G_OBJECT (shell->priv->tray_icon), "destroy",
                                 G_CALLBACK (tray_destroy_cb), shell, 0);
        g_signal_connect_object (G_OBJECT (shell->priv->tray_icon), "embedded",
                                 G_CALLBACK (tray_embedded_cb), shell, 0);

        gtk_widget_show_all (GTK_WIDGET (shell->priv->tray_icon));

        rb_debug ("done creating new tray icon %p", shell->priv->tray_icon);
        return TRUE;
}
Comment 9 Pascal Terjan 2006-12-03 22:03:33 UTC
The issue is that both use egg.
With GtkStatusIcon, we can't use the destroy signal.
Comment 10 Pascal Terjan 2006-12-03 22:40:10 UTC
gnomeicu uses GtkStatusIcon and works fine regarding this issue, but I can't find anything helpful in their tray.c
Comment 11 Pascal Terjan 2006-12-03 23:11:18 UTC
OK I was using an old version of gnomeicu which was using egg. With CVS version they have the same issue...
I think a bug against GtkStatusIcon should be opened
Comment 12 Richard Hughes 2006-12-09 20:05:57 UTC
Yes, agree. I think the bug is with GtkStatusIcon.
Comment 13 Alan 2007-01-25 03:49:29 UTC
I have been using Gimmie lately, and every other time or so after Gimmie crashes (frequently, I might add, but that is neither here nor there) the status icon reattaches. This is with 2.16.1
Comment 14 Richard Hughes 2007-01-27 12:54:35 UTC
Pascal, cheers for working on this.
Comment 15 Richard Hughes 2007-06-17 22:40:48 UTC
*** Bug 448061 has been marked as a duplicate of this bug. ***
Comment 16 Pascal Terjan 2007-06-17 23:21:05 UTC
This now works fine with latest Gtk.