~ubuntu-branches/ubuntu/quantal/xfce4-power-manager/quantal-proposed

« back to all changes in this revision

Viewing changes to debian/patches/10_dim_brightness.patch

  • Committer: Package Import Robot
  • Author(s): Julien Lavergne
  • Date: 2012-03-18 17:38:44 UTC
  • Revision ID: package-import@ubuntu.com-20120318173844-alounqmy70m3ed1c
Tags: 1.0.10-5ubuntu2
* debian/patches:
 - 07_fix_broken_empty_icon_battery.patch: From upstream, fix empty icons in
   the systray (LP: #846878)
 - 08_show_preferences_lxde.patch: Hide settings menu only on desktop
   environment which have another power manager.
 - 09_fix_insert_battery.patch: Another patch to fix empty icon when
   removing a battery. Thanks Henry Gebhardt for the patch.
 - 10_dim_brightness.patch: From upstream, only dim brightness if the current
   level is brighter. (LP: #900592)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Origin: commit:ab07509cdf0fa05c56ae61a020abce2ac1fb28cb
 
2
From: Ali Abdallah <aliov@xfce.org>
 
3
Subject: Only dim brightness if the current level is brighter.
 
4
 
 
5
---
 
6
diff --git a/src/xfpm-backlight.c b/src/xfpm-backlight.c
 
7
index 94a4f44..73bd5f6 100644
 
8
--- a/src/xfpm-backlight.c
 
9
+++ b/src/xfpm-backlight.c
 
10
@@ -104,9 +104,15 @@ xfpm_backlight_dim_brightness (XfpmBacklight *backlight)
 
11
        
 
12
        dim_level = dim_level * backlight->priv->max_level / 100;
 
13
        
 
14
-       XFPM_DEBUG ("Current brightness level before dimming : %li, new %li", backlight->priv->last_level, dim_level);
 
15
-       
 
16
-       backlight->priv->dimmed = xfpm_brightness_set_level (backlight->priv->brightness, dim_level);
 
17
+       /**
 
18
+        * Only reduce if the current level is brighter than
 
19
+        * the configured dim_level
 
20
+        **/
 
21
+       if (backlight->priv->last_level > dim_level)
 
22
+       {
 
23
+           XFPM_DEBUG ("Current brightness level before dimming : %li, new %li", backlight->priv->last_level, dim_level);
 
24
+           backlight->priv->dimmed = xfpm_brightness_set_level (backlight->priv->brightness, dim_level);
 
25
+       }
 
26
     }
 
27
 }
 
28
 
 
29
--
 
30
cgit v0.9.0.2