[Kde-hardware-devel] various org.freedesktop.ScreenSaver issues

Oliver Henshaw oliver.henshaw at gmail.com
Thu Dec 6 18:47:11 UTC 2012


Hi,

Prompted by what seems to be a renewed focus on the
org.freedesktop.ScreenSaver interface [1][2][3] I've noticed some
problems with the KDE implementation, and have some ideas how to solve
them:

* ScreenSaver inhibit does not imply powerdevil ChangeScreenSettings
(i.e. DPMS) inhibit, and vice versa,
* Neither inhibit implies powerdevil InterruptSession (i.e system
suspend) inibit,
* The Solid::PowerManagement::*SuppressingScreenPowerManagement
functions only use the ScreenSaver.Inhibit interface if the powerdevil
PolicyAgent interface is present.

The first problem is partly obscured by the fact that some third-party
ScreenSaver.Inhibit users also turn off DPMS directly - albeit in a
way that doesn't work in gnome but currently does in KDE. It seems the
pre-4.10 screensaver did check the DPMS status before activating but
I'm not sure whether porting over that code is the right solution -
it's not a complete solution anyway. This may also mean that
ScreenSaver inhibit doesn't prevent powerdevil dimming the screen.

The second problem is strictly correct as far as the powerdevil API
goes, it's just not very useful[4] - although it's possible to argue
that suspending the computer changes screen settings. I can't think of
any use case for keeping the screen awake but still auto-suspending
the computer after an idle timeout. And it's probably not what users
of the ScreenSaver interface want.

The third problem simply prevents applications using these functions
working as intended in versions of gnome that support the ScreenSaver
inhibit interface.


So, I propose the following as minimal fixes, hopefully suitable for 4.10:

* Have the ksmserver screenlocker pass ScreenSaver inhibits on to
powerdevil via the PolicyAgent interface
* Possibly have the ksmserver screenlocker check DPMS activation
status before activating, although maybe not in a straight port of the
krunner screensaver code
* Change the powerdevil PolicyAgent to always have
ChangeScreenSettings imply InterruptSession (as an alternative, have
just the ScreenSaver and
Solid::PowerManagement::beginSuppressingScreenPowerManagement use the
InterruptSession flag - as I understand it, applications shouldn't be
using the kde-namespaced dbus interfaces directly, is that correct?)
* Have Solid::PowerManagement::*SuppressingScreenPowerManagement
unconditionally call org.freedesktop.ScreenSaver. Further to this, is
there any benefit to trying org.kde.Solid.PowerManagement.PolicyAgent
first? I'm not sure whether there's any tricky ABI issues in changing
the Solid::PowerManagement implementation?

I'll have review requests for these proposals, hopefully in the next day or so.

Thoughts?

Oliver


[1] https://bugzilla.gnome.org/show_bug.cgi?id=689225
[2] https://trac.videolan.org/vlc/ticket/7824
[3] https://bugzilla.mozilla.org/show_bug.cgi?id=811261
[4] Very briefly discussed at
http://drfav.wordpress.com/2012/01/18/some-news-and-improvements-in-inhibition/#comment-2420


More information about the Kde-hardware-devel mailing list