Bug 310273

Summary: Auto-brightness setting fights my manual control
Product: [openSUSE] openSUSE 10.3 Reporter: Federico Mena Quintero <federico>
Component: GNOMEAssignee: Scott Reeves <sreeves>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P5 - None CC: 52152, behlert, coolo, felix.rommel, hpj, secsaba
Version: Beta 3Flags: coolo: SHIP_STOPPER-
Target Milestone: ---   
Hardware: i386   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: proposed patch

Description Federico Mena Quintero 2007-09-13 15:00:38 UTC
If my laptop is running on battery power, it will dim the display after a little while of inactivity.  This often happens when I'm reading something, so I'll go and hit the "increase brightness" key combination a few times.  Sometimes, the auto-dim feature kicks back in exactly when I'm increasing the brightness, so it "fights" me for control.

The auto-dim feature should not kick in while I'm manually tweaking the brightness; it should probably even not modify the brightness after I've set it manually.
Comment 1 Magnus Boman 2007-09-17 22:20:12 UTC
This happens here as well.
Thinkpad T43P.
It makes the laptop unusable on battery for me as I can't read the screen.
Comment 2 Miguel Angel Barajas 2007-09-22 18:43:43 UTC
The same in Thinkpad Z61t
Comment 3 JP Rosevear 2007-09-22 19:39:40 UTC
*** Bug 326836 has been marked as a duplicate of this bug. ***
Comment 4 Scott Reeves 2007-09-26 17:53:52 UTC
In this bug and the duplicates of it there seems to be 3 issues -
1. Don't dim screen again if user immediately undims after a auto dim.  Latest g-p-m contains code that detects if the user immediately undims and doubles the timeout.

2. Brightness hotkeys not working correctly. I have a patch that fixes this issue on my box. Could others try it - http://w3.suse.de/~sreeves/dist_stable/gnome-power-manager-2.20.0-6.i586.rpm

3. Manual vs auto fighting each other - still working on this.
Comment 5 Scott Reeves 2007-09-26 21:45:17 UTC
hrmm, realized that file is wrong and I need x86_64 versions also.

So pull from here - http://w3.suse.de/~sreeves/power_manager/
Comment 6 Hans Petter Jansson 2007-09-27 19:50:32 UTC
I'm being fought wen I try to adjust brightness using hardware buttons too. I also get this in my syslog:

Sep 27 14:42:14 kzerza kernel: thinkpad_acpi: CMOS NVRAM (5) and EC (7) do not agree on display brightness level
Comment 7 JP Rosevear 2007-09-28 16:41:50 UTC
Works here now.
Comment 8 Scott Reeves 2007-09-29 00:11:43 UTC
Created attachment 175608 [details]
proposed patch
Comment 9 Hans Petter Jansson 2007-10-01 18:51:51 UTC
In gpm_applet_get_brightness(), you're changing policy_brightness into a signed int, but the following dbus_g_proxy_call() is still passing it as an uint. Why change the var's signedness if you're not changing the marshaling call?

Apart from that, the patch looks ok.
Comment 10 Hans Petter Jansson 2007-10-01 18:52:53 UTC
Oh, and please add the -p flag to your diff commandline for future diffs. It eases patch review slightly :)
Comment 11 Hubert Figuiere 2007-10-02 00:24:00 UTC
*** Bug 330017 has been marked as a duplicate of this bug. ***
Comment 12 Hubert Figuiere 2007-10-02 00:24:27 UTC
(In reply to comment #5 from Scott Reeves)
> hrmm, realized that file is wrong and I need x86_64 versions also.
> 
> So pull from here - http://w3.suse.de/~sreeves/power_manager/
> 


Works for me on my X60. Thanks.
Comment 13 Scott Reeves 2007-10-02 20:47:47 UTC
Regarding comment #9 the applet changes were left over cruft from starting to apply similar changes but it uses a different dbus interface that actually does expect a uint.  Which is what I suspect is the root cause of this bug upstream in the first place - different param signatures on the interfaces.

Fixed this and submitted to stable and 10.3

Submitted this patch for upstream inclusion also.
Comment 14 Federico Mena Quintero 2007-10-07 18:00:15 UTC
This works beautifully now.  Thanks, Scott!  
Comment 15 Timo Hoenig 2007-10-09 10:02:05 UTC
*** Bug 332061 has been marked as a duplicate of this bug. ***
Comment 16 Csaba Simon 2007-10-13 17:13:47 UTC
Latest stable openSUSE 10.3 GNOME:

> killall gnome-power-manager
> gnome-power-manager --no-daemon

(gnome-power-manager:5112): GLib-GObject-CRITICAL **: g_value_set_int: assertion `G_VALUE_HOLDS_INT (value)' failed

> rpm -q gnome-power-manager
gnome-power-manager-2.20.0-5

The problem still persist. The brightness cannot be changed if gnome-power-manager is running.
Comment 18 JP Rosevear 2007-10-31 00:37:30 UTC
*** Bug 268115 has been marked as a duplicate of this bug. ***
Comment 19 JP Rosevear 2007-10-31 17:17:56 UTC
There was an issue getting this released, its been re-submitted for release