Summary: | Screen brightness does not change because powerdevil truncates the new value, which equals to the old value. | ||
---|---|---|---|
Product: | [Unmaintained] solid | Reporter: | Lamarque V. Souza <lamarque> |
Component: | powermanagement | Assignee: | Dario Freddi <drf> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mr.challinger, robin.bankhead |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Fixes the truncate problem in brightness value |
... or simply using qRound ? Yeah, that also works. Adding 0.5 before the cast also works. There are several ways to do the same thing :-) SVN commit 1217574 by lvsouza: Rounds value instead of truncating it. This fix a problem with increasing brightness key not working sometimes. CCBUG: 264534 M +1 -1 xrandrbrightness.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1217574 SVN commit 1217581 by lvsouza: Backport r1217574 by lvsouza from trunk to the 4.6 branch: Rounds value instead of truncating it. This fix a problem with increasing brightness key not working sometimes. CCBUG: 264534 M +1 -1 xrandrbrightness.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1217581 Comment on attachment 56535 [details]
Fixes the truncate problem in brightness value
Fixed in a different way. The file in question is pure C, so I used simple math to round the value instead of qRound.
*** Bug 266005 has been marked as a duplicate of this bug. *** Hi, I was directed here from bug 181444 and would like to ask whether my case might be caused by this bug. I cannot increase brightness at all from the keyboard shortcut (and I have tried a variety of shortcuts), but dimming works perfectly from any initial value. Also the slider and brightness changes caused by idle/idle-stop work as expected. Could this be the same underlying cause? Hardware is a Samsung NC10 netbook with Intel 945GME graphics, kde 4.6.0 (no HAL) on Gentoo unstable. Just to add that my screen has 8 different brightness levels (including 0 and 100%), each being a 14.3% increment. I established this using xbacklight, which also tells me (I think) that it's the "floor" of the percentage you feed it (i.e. the setting you get is always rounded down from the percentage you want). I don't know if this is driver-specific behaviour or what, but seems like it might be related. For example, if I do xbacklight + 14 nothing happens, but I can do xbacklight - 1 and the brightness will drop to the next lower setting. The symptoms you described match this bug's symptoms. Try 4.6.1 and it should work. The brightness slide increments brightness "continuously" with 1% value steps, in that case truncating and rouding results in the same value. On the other hand the brightness keys increment by big steps (~14% in your case), which makes it more likely to the truncated value differ from the rounded value. Thanks, I'll have to wait until Gentoo release 4.6.1 but will post back if it doesn't work. As you don't mention it above, is it the case that *decreasing* brightness by keys worked fine for you too (before the patch)? The decrease brightness key works without this patch because truncating a float point number is the same thing as rounding it down. I applied the fix to the sources for 4.6.0 and it does indeed work. Thanks again! |
Created attachment 56535 [details] Fixes the truncate problem in brightness value Version: unspecified (using KDE 4.6.0) OS: Linux After upgrading from 4.5.4 to 4.6.0 I noticed that when pressing the "increase brightness" key (Fn+F9 in my notebook) it does not increase the brigthness sometimes (only sometimes). My LCD has only 7 brightness levels, powerdevil calcules the brightness in percent. Powerdevil converts from percent to the 7 levels in powerdevil/daemon/backends/upower/xrandrbrightness.cpp:XRandrBrightness::setBrightness. The value is truncated when converted from double to long, which sometimes makes it equals the old value and consequently the brightness is not increased. Reproducible: Always Steps to Reproduce: 1. You need a LCD monitor with few brightness levels (7 in my case). 2. Set brigthness to the minimum using powerdevil applet's brightness slide. 3. Try increasing the brightness using shortcut key. It does not increase. 4. Set brigthness to ~60% using powerdevil applets's brightness slide. 5. Try increasing the brightness using shortcut key. It works in this case. Actual Results: The increase brightness key only increases brightness when it is already above ~50%. Expected Results: The increase brigthness key should always increase brigthness until it reaches the maximum. The attached patch fixed the problem for me. By the way, my notebook is a Sager NP7652.