[PolicyAgent] Ignore "Keep screen on" request while screen is locked
ClosedPublic

Authored by broulik on Jun 15 2016, 6:57 PM.

Details

Summary

When an application is blocking power management, such as a video player, the screen will stay on and will not automatically lock, which is good.

However, if the screen is manually locked it will stay on indefinitely (until the inhibition is released) which is pointless as you cannot see the video anymore either and you can't do anything with the computer anmyore. When the screen is unlocked, the original policy comes into effect again.

Test Plan

I'm listening to music all day here and when I leave my laptop I lock it manually but the screen stays on forever because of the music playback.

Diff Detail

Repository
R122 Powerdevil
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik updated this revision to Diff 4526.Jun 15 2016, 6:57 PM
broulik retitled this revision from to [PolicyAgent] Ignore "Keep screen on" request while screen is locked.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added reviewers: Plasma, Plasma: Design.
broulik set the repository for this revision to R122 Powerdevil.
Restricted Application added a project: Plasma. · View Herald TranscriptJun 15 2016, 6:57 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

Makes sense!

Just as a note: KWin uses a DBusServiceWatcher to monitor the Screenlocker interface. See effects.cpp.

broulik updated this revision to Diff 4539.Jun 16 2016, 9:06 AM
  • Add serviceOwnerWatcher to notice when screensaver service comes and goes
  • Put initialization from constructor into init() method like the rest is
mart accepted this revision.Jun 28 2016, 8:37 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Jun 28 2016, 8:38 AM
This revision was automatically updated to reflect the committed changes.