Rework of the org.freedesktop.ScreenSaver API?
Bastien Nocera
hadess at hadess.net
Wed Nov 28 10:10:28 PST 2012
Heya,
I've started looking at the screensaver inhibition problem for GNOME
3.6, as we've remove the hacks[1] that people were sometimes using to
inhibit the screensaver coming on.
I missed the discussions about the old screensaver API that KDE and
GNOME developers discussed but only KDE implemented:
https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/master/entry/ksmserver/screenlocker/dbus/org.freedesktop.ScreenSaver.xml
and I hope we can work something out now.
I've implemented a proxy for this in GNOME[2], which I'll backport to
3.6 when it's had a bit of testing. Only the Inhibit/UnInhibit and the
Throttle/UnThrottle pairs are implemented (and the latter is a no-op).
The API is bit a iffy, and shows how things are implemented underneath.
Here's a list of things I think we'd need to clean up in a new API:
- Only define application API, not system-level API (what's the use
knowing that the screensaver is actually on, or the session idle time?)
- What's SimulateUserActivity for? It looks like a way to avoid using
the API, or maybe a way for apps to not link to D-Bus. I think that we
should remove this if we agree and implement this API.
- Inhibition should be done at the session level, with the session
controlling the screensaver (or the screensaver asking the session,
whichever). Could we rename the interface to not include "screensaver"
in the name?
- As for the Inhibition APIs, gnome-session can inhibit more than just
the screensaver (log out, user switching, suspend, and auto-mounting):
http://git.gnome.org/browse/gnome-session/tree/gnome-session/org.gnome.SessionManager.xml#n148
FWIW, I'm fine with only having idle inhibition spec'ed on fd.o if we're
only going to be targetting applications with this API.
In the meanwhile, does somebody want to publish the original spec as it
was written? It would be something useful for application developers to
use right now, even if only that 4 aforementioned calls are listed.
Cheers
[1]: gnome-screensaver-command --poke, or whatever it was called.
[2]: https://bugzilla.gnome.org/show_bug.cgi?id=689225
More information about the xdg
mailing list