Bug 173146

Summary: weird brightness screen behavior
Product: [Frameworks and Libraries] guidance-power-manager Reporter: Cristiano Moraes <cristiano.moraes>
Component: generalAssignee: Jonathan Riddell <jr>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: cfeck, michal, ssb
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandriva RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Cristiano Moraes 2008-10-19 15:22:48 UTC
Version:            (using KDE 4.1.1)
OS:                Linux
Installed from:    Mandriva RPMs

I'm using Mandriva 2009.

The lcd screen brightness of my laptop never stays in maximum even after I plug AC cable.

If I drag brightness control in Saver Power Icon to maximum, screen brightness goes to maximum, but few seconds later it goes back to minimun.

Also, sometimes, during regular use, without any reason the screen brightness goes to maximum and back to minimum again.

It used to work properly in kde 3.5.
Comment 1 ssb 2010-12-16 23:36:43 UTC
This and 247975 are both solved by a trivial patch:

--- guidance-power-manager.py.orig      2010-02-11 16:06:45.000000000 -0600
+++ guidance-power-manager.py   2010-12-16 16:21:47.913334879 -0600
@@ -373,7 +373,7 @@
             batteryBrightness = self.config.readEntry("batteryBrightness", QVariant(int(brightness_high/2)))
             batteryBrightness = batteryBrightness.toInt()
             batteryBrightness = batteryBrightness[0]
-            poweredBrightness = self.config.readEntry("poweredBrightness", QVariant(brightness_high))
+            poweredBrightness = self.config.readEntry("poweredBrightness", QVariant(int(brightness_high)))
             poweredBrightness = poweredBrightness.toInt()
             poweredBrightness = poweredBrightness[0]
             self.BatteryBrightnessSlider.setValue(batteryBrightness) #default middle
@@ -1104,7 +1104,7 @@
         if self.pmwidget.powermanager.hasBrightness:
             brightness_high = self.pmwidget.powermanager.brightness_levels
             if not self.pmwidget.powermanager.onBattery():
-                poweredBrightness = self.pmwidget.config.readEntry("poweredBrightness", QVariant(brightness_high))
+                poweredBrightness = self.pmwidget.config.readEntry("poweredBrightness", QVariant(int(brightness_high)))
                 level = poweredBrightness.toInt()
                 level = level[0]
             else:

I know almost nothing about Python or QT, but a few "print"s showed that the value retrieved for poweredBrightness was coming up as 0 when that is not what was in the config file.  I expect that this is working as a result of a side-effect of "int()" rather than using the proper method to retrieve the integer value, but I'd about given up on g-p-m due to always having my brightness go to minimum on switching to line power or canceling out of the dialog and with these changes, it is working properly so I'm able to continue using it.

I'm pretty sure it also solves 176485 other than the add-on issue of function buttons.  In my case, (Dell E6500 laptop), the brightness buttons have always worked fine, so I haven't looked into that.
Comment 2 Lamarque V. Souza 2011-02-05 00:50:32 UTC
*** Bug 176485 has been marked as a duplicate of this bug. ***
Comment 3 Christoph Feck 2011-09-24 21:19:34 UTC
The "guidance-power-manager" is unmaintained and has been replaced with "Powerdevil". If this issue needs to be addressed in recent KDE versions, such as 4.6.5 or 4.7.x, please add a comment, or report it to "solid/powermanagement" bugzilla product.