From 6f87cc775b4c72f5708d6582173077b856ba01f5 Mon Sep 17 00:00:00 2001 From: Henry Gebhardt Date: Wed, 29 Feb 2012 14:14:33 +0100 Subject: [PATCH] Fix empty systray icon in some panels on battery removal and addition Unreferencing a GtkStatusIcon is not enough to get rid of it entirely. This fixes these bugs: https://bugzilla.xfce.org/show_bug.cgi?id=7603 http://bugzilla.xfce.org/show_bug.cgi?id=8424 https://bugs.launchpad.net/ubuntu/+source/lxpanel/+bug/846878 https://bugzilla.redhat.com/show_bug.cgi?id=765726 --- src/xfpm-battery.c | 2 ++ src/xfpm-power.c | 1 + 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/xfpm-battery.c b/src/xfpm-battery.c index 763b014..51699a9 100644 --- a/src/xfpm-battery.c +++ b/src/xfpm-battery.c @@ -780,6 +780,8 @@ xfpm_battery_finalize (GObject *object) g_object_unref (battery->priv->notify); g_object_unref (battery->priv->button); + gtk_status_icon_set_visible(GTK_STATUS_ICON(battery), FALSE); + G_OBJECT_CLASS (xfpm_battery_parent_class)->finalize (object); } diff --git a/src/xfpm-power.c b/src/xfpm-power.c index 45ad928..787bc1c 100644 --- a/src/xfpm-power.c +++ b/src/xfpm-power.c @@ -1114,6 +1114,7 @@ xfpm_power_hide_adapter_icon (XfpmPower *power) if ( power->priv->adapter_icon ) { + gtk_status_icon_set_visible (power->priv->adapter_icon, FALSE); g_object_unref (power->priv->adapter_icon); power->priv->adapter_icon = NULL; } -- 1.7.8.4