[Xfce4-commits] <xfce4-power-manager:master> Fix adapter icon when no battery present (bug #6008)

Ali Abdallah noreply at xfce.org
Sat Nov 21 13:44:01 CET 2009


Updating branch refs/heads/master
         to 06411e608eec35491e73ce7eb1b8c3d3933d49db (commit)
       from bc6c4383de0a58cd8f86ff8141d93e3df4877aab (commit)

commit 06411e608eec35491e73ce7eb1b8c3d3933d49db
Author: Ali Abdallah <ali at ali-xfce.org>
Date:   Sat Nov 21 13:37:18 2009 +0100

    Fix adapter icon when no battery present (bug #6008)

 src/xfpm-supply.c    |    5 +++--
 src/xfpm-tray-icon.c |    5 +++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/xfpm-supply.c b/src/xfpm-supply.c
index b71dc8d..01d855b 100644
--- a/src/xfpm-supply.c
+++ b/src/xfpm-supply.c
@@ -213,6 +213,7 @@ xfpm_supply_hide_adapter_icon (XfpmSupply *supply)
 {
     if ( supply->priv->tray )
     {
+	TRACE ("hide adapter icon");
 	g_object_unref (supply->priv->tray);
 	supply->priv->tray = NULL;
     }
@@ -231,8 +232,8 @@ xfpm_supply_show_tray_icon (XfpmSupply *supply)
 #endif    
 
     supply->priv->tray = xfpm_tray_icon_new ();
-    
-    xfpm_tray_icon_set_visible (supply->priv->tray, FALSE);
+    TRACE ("show adapter icon");
+    xfpm_tray_icon_set_visible (supply->priv->tray, TRUE);
     xfpm_tray_icon_set_icon (supply->priv->tray, XFPM_AC_ADAPTER_ICON);
     xfpm_tray_icon_set_show_info_menu (supply->priv->tray, FALSE);
 }
diff --git a/src/xfpm-tray-icon.c b/src/xfpm-tray-icon.c
index 15713d3..ed1f116 100644
--- a/src/xfpm-tray-icon.c
+++ b/src/xfpm-tray-icon.c
@@ -85,6 +85,11 @@ xfpm_tray_icon_size_changed_cb (GtkStatusIcon *icon, gint size, XfpmTrayIcon *tr
     GdkPixbuf *pix;
     
     g_return_val_if_fail (size > 0, FALSE);
+    
+    g_debug ("Size Changed %d icon=%s", size, g_quark_to_string (tray->priv->icon_quark));
+    
+    if ( size > 128 )
+	return FALSE;
 
     if ( tray->priv->icon_quark == 0 )
 	return FALSE;



More information about the Xfce4-commits mailing list