Bug 272438 - brightness not restored when dimming happens while the screen is turned off
Summary: brightness not restored when dimming happens while the screen is turned off
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
: 271478 272917 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-05-04 13:46 UTC by S. Burmeister
Modified: 2022-06-04 23:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.7.2


Attachments
powerdevilrc (198 bytes, application/octet-stream)
2011-09-30 12:52 UTC, S. Burmeister
Details
powerdevil2profilesrc (1.04 KB, application/octet-stream)
2011-09-30 13:03 UTC, S. Burmeister
Details
powerdevilprofilesrc (2.20 KB, application/octet-stream)
2011-09-30 13:04 UTC, S. Burmeister
Details

Note You need to log in before you can comment on or make changes to this bug.
Description S. Burmeister 2011-05-04 13:46:14 UTC
Version:           unspecified (using KDE 4.6.2) 
OS:                Linux

If the display is turned off by powerdevil before the dimming happens the brigthness is not restored after the display is powered on again.

Expected behaviour: always restore the brigtness set in the active scheme when the mouse is moved. Do not dimm is display is powered-off.

This bug has been around since KDE 4.6.0 and is a regression compared to KDE SC 4.5.

Reproducible: Always
Comment 1 S. Burmeister 2011-05-04 13:48:19 UTC
Oh, and it is _NOT_ a dup of bug 261590 since that one is marked as fixed for 4.6.1 which is obviously a false statement if it was a bug.
Comment 2 Matěj Laitl 2011-05-29 22:21:10 UTC
This is a duplicate of bug 271478. (which is slightly older than this)
Comment 3 Dario Freddi 2011-09-30 11:51:15 UTC
*** Bug 271478 has been marked as a duplicate of this bug. ***
Comment 4 Dario Freddi 2011-09-30 12:06:11 UTC
I cannot reproduce on trunk, both in case the dimming happens before the DPMS
kicks in, and the other way round. Can you please confirm this is still an
issue?
Comment 5 S. Burmeister 2011-09-30 12:52:44 UTC
Created attachment 64096 [details]
powerdevilrc
Comment 6 S. Burmeister 2011-09-30 13:03:39 UTC
Created attachment 64097 [details]
powerdevil2profilesrc
Comment 7 S. Burmeister 2011-09-30 13:04:31 UTC
Created attachment 64098 [details]
powerdevilprofilesrc

Profiles that cause the issue even with 4.7
Comment 8 Dario Freddi 2011-09-30 13:19:33 UTC
(P.S.: You need to look at powerdevil2profilesrc, that file is the old version's one)

Btw, I think I found the cause for this bug, even if I triggered it in a different way. Unsurprisingly, the problem is related to polkit+consolekit.

That's what happens: when the screen starts to dim, it tries to get back the current brightness. But, in your case and in mine as well, the action does not succeed (I guess you can verify this easily in your kded4 output), hence the value returned is 0. I'm betting you have screen locking enabled, that's why the session gets inactive.

To workaround this bug, the proper fix is changing the policy to allow the system to get the brightness even if the console is inactive, as there is no other way. This requires first of all a patch in KAuth, and afterwards a small addition to powerdevil. In the meanwhile, you can try changing permissions by yourself and get this bug fixed.
Comment 9 Dario Freddi 2011-09-30 13:28:21 UTC
*** Bug 272917 has been marked as a duplicate of this bug. ***
Comment 10 Dario Freddi 2011-09-30 13:30:38 UTC
To test if this is the reason, edit
/usr/share/polkit-1/actions/org.kde.powerdevil.backlighthelper.policy, and set
allow_inactive of the .brightness action to "yes".
Comment 11 Dario Freddi 2011-09-30 14:03:34 UTC
Git commit 96cafc57a6f2faf3c18f087b15d72aca56bd4895 by Dario Freddi.
Committed on 30/09/2011 at 15:59.
Pushed by dafre into branch 'KDE/4.7'.

KAuth should be able to parse correctly policies for inactive consoles

CCBUG: 272438

M  +8    -3    kdecore/auth/backends/policykit/kauth-policy-gen-polkit.cpp
M  +8    -3    kdecore/auth/backends/polkit-1/kauth-policy-gen-polkit1.cpp
M  +8    -0    kdecore/auth/policy-gen/policy-gen.cpp
M  +1    -0    kdecore/auth/policy-gen/policy-gen.h

http://commits.kde.org/kdelibs/96cafc57a6f2faf3c18f087b15d72aca56bd4895
Comment 12 Dario Freddi 2011-09-30 14:05:08 UTC
Git commit 0397c756762c1211f7128ed83149d8e56c0565a3 by Dario Freddi.
Committed on 30/09/2011 at 15:59.
Pushed by dafre into branch 'frameworks'.

KAuth should be able to parse correctly policies for inactive consoles

CCBUG: 272438

M  +8    -3    tier1/libkauth/backends/policykit/kauth-policy-gen-polkit.cpp
M  +8    -3    tier1/libkauth/backends/polkit-1/kauth-policy-gen-polkit1.cpp
M  +8    -0    tier1/libkauth/policy-gen/policy-gen.cpp
M  +1    -0    tier1/libkauth/policy-gen/policy-gen.h

http://commits.kde.org/kdelibs/0397c756762c1211f7128ed83149d8e56c0565a3
Comment 13 Dario Freddi 2011-09-30 14:08:31 UTC
Git commit e6c99554efb7f3fbb09aa20ad58b4695426a3822 by Dario Freddi.
Committed on 30/09/2011 at 16:06.
Pushed by dafre into branch 'master'.

The system should always be able to fetch brightness. For this reason, allow
this action to be performed even on inactive consoles - after all, it's anything
but harmful.

Note this depends on KAuth's 96cafc57a6f2faf3c18f087b15d72aca56bd4895 in KDE 4.7
to work properly.

BUG: 272438
FIXED-IN: 4.7.2

M  +1    -0    powerdevil/daemon/backends/upower/backlight_helper_actions.actions

http://commits.kde.org/kde-workspace/e6c99554efb7f3fbb09aa20ad58b4695426a3822
Comment 14 Dario Freddi 2011-09-30 14:12:55 UTC
Git commit daf0f9eec12f94ac352069e181bfa93812a19eef by Dario Freddi.
Committed on 30/09/2011 at 16:06.
Pushed by dafre into branch 'KDE/4.7'.

The system should always be able to fetch brightness. For this reason, allow
this action to be performed even on inactive consoles - after all, it's anything
but harmful.

Note this depends on KAuth's 96cafc57a6f2faf3c18f087b15d72aca56bd4895 in KDE 4.7
to work properly.

BUG: 272438
FIXED-IN: 4.7.2

M  +1    -0    powerdevil/daemon/backends/upower/backlight_helper_actions.actions

http://commits.kde.org/kde-workspace/daf0f9eec12f94ac352069e181bfa93812a19eef