Updating branch refs/heads/devkit-power
         to 1a05f46a8bb24eff0d1af6b55cdf8001b1fea1a6 (commit)
       from e58f1477f7011a1f9d2e5a65d6c9aecf17e57e41 (commit)

commit 1a05f46a8bb24eff0d1af6b55cdf8001b1fea1a6
Author: Ali Abdallah <al...@xfce.org>
Date:   Sun Nov 29 17:09:26 2009 +0100

    Fix brightness notification feedback level.

 src/xfpm-backlight.c |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/src/xfpm-backlight.c b/src/xfpm-backlight.c
index da7aafe..f5e13c3 100644
--- a/src/xfpm-backlight.c
+++ b/src/xfpm-backlight.c
@@ -124,7 +124,6 @@ xfpm_backlight_show_notification (XfpmBacklight *backlight, 
gint level, gint max
 {
     gint i;
     gfloat value = 0;
-    NotifyNotification *n;
     
     static const char *display_icon_name[] = 
     {
@@ -136,36 +135,38 @@ xfpm_backlight_show_notification (XfpmBacklight 
*backlight, gint level, gint max
        NULL
     };
     
-    if ( !backlight->priv->n )
+    if ( backlight->priv->n == NULL )
     {
-       n = xfpm_notify_new_notification (backlight->priv->notify, 
-                                         NULL, 
-                                         NULL, 
-                                         NULL, 
-                                         0, 
-                                         XFPM_NOTIFY_NORMAL,
-                                         NULL);
+       backlight->priv->n = xfpm_notify_new_notification 
(backlight->priv->notify, 
+                                                          " ", 
+                                                          "", 
+                                                          NULL, 
+                                                          0, 
+                                                          XFPM_NOTIFY_NORMAL,
+                                                          NULL);
     }
     
     value = (gfloat) 100 * level / max_level;
     
     i = (gint)value / 25;
     
-    notify_notification_set_hint_int32  (n,
+    if ( i > 4 || i < 0 )
+       return;
+    
+    notify_notification_set_hint_int32  (backlight->priv->n,
                                         "value",
                                         value);
     
-    notify_notification_set_hint_string (n,
+    notify_notification_set_hint_string (backlight->priv->n,
                                         "x-canonical-private-synchronous",
                                         "brightness");
-                                        
-    notify_notification_update (n,
+    
+    notify_notification_update (backlight->priv->n,
                                " ",
                                "",
                                display_icon_name[i]);
                                
-    notify_notification_show (n, NULL);
-    backlight->priv->n = n;
+    notify_notification_show (backlight->priv->n, NULL);
 }
 
 static gboolean
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to