After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 689225 - screensaver-proxy: Add new screesaver proxy plugin
screensaver-proxy: Add new screesaver proxy plugin
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-28 15:56 UTC by Bastien Nocera
Modified: 2015-01-26 18:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screensaver-proxy: Add new screesaver proxy plugin (28.20 KB, patch)
2012-11-28 15:56 UTC, Bastien Nocera
none Details | Review
screensaver-proxy: Add new screesaver proxy plugin (28.77 KB, patch)
2012-11-28 16:26 UTC, Bastien Nocera
none Details | Review
screensaver-proxy: Add new screesaver proxy plugin (33.02 KB, patch)
2012-11-28 17:41 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2012-11-28 15:56:39 UTC
Untested, but compiles.
Comment 3 Bastien Nocera 2012-11-28 17:41:08 UTC
Created attachment 230106 [details] [review]
screensaver-proxy: Add new screesaver proxy plugin

Proxy the org.freedesktop.ScreenSaver D-Bus API to gnome-session
as needed.

Note that, as we are the one talking to gnome-session, automatically
removing inhibition cookies when the caller goes away won't work.
We must watch incoming inhibition requests, and make sure to clean up
and remove lingering cookies when the caller goes away.

API:
https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/master/entry/ksmserver/screenlocker/dbus/org.freedesktop.ScreenSaver.xm
Documentation:
https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/master/entry/ksmserver/screenlocker/interface.h
Comment 4 Milan Bouchet-Valat 2012-11-29 14:11:04 UTC
This would really be a fantastic addition!
Comment 5 Milan Bouchet-Valat 2012-11-29 14:27:21 UTC
BTW, I've pinged MPlayer to let them know they can use the interface:
http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1887
Comment 6 Matthias Clasen 2012-11-30 14:59:34 UTC
After installing this, I see

** (gnome-settings-daemon:23652): WARNING **: Cannot load plugin 'Screensaver Proxy' since file '/home/mclasen/gnome/lib64/gnome-settings-daemon-3.0/libscreensaver-proxy.so' cannot be read.

I do have libscreensaver_proxy.so, but no libscreensaver-proxy.so
Comment 7 Matthias Clasen 2012-11-30 15:01:21 UTC
This fixes the install problem:

diff --git a/plugins/screensaver-proxy/Makefile.am b/plugins/screensaver-proxy/M
index 5510024..38d908b 100644
--- a/plugins/screensaver-proxy/Makefile.am
+++ b/plugins/screensaver-proxy/Makefile.am
@@ -1,6 +1,6 @@
 plugin_name = screensaver-proxy
 
-plugin_LTLIBRARIES = libscreensaver_proxy.la
+plugin_LTLIBRARIES = libscreensaver-proxy.la
 
 libscreensaver_proxy_la_SOURCES =      \
        gsd-screensaver-proxy-manager.c \
Comment 8 Matthias Clasen 2012-11-30 15:11:01 UTC
Seems to work as advertised, otherwise.

The code looks fine. 

The only minor comments I have are:

- The Authors=AUTHOR line in the .plugin file does not get replaced with your name - should it ?

- It would be good to add a comment (maybe up top, where you refer to the kde docs) explaining which functions are implemented, and why the others aren't.
Comment 9 Bastien Nocera 2012-11-30 19:02:05 UTC
Attachment 230106 [details] pushed as e8f032b - screensaver-proxy: Add new screesaver proxy plugin
Comment 10 daryl5 2015-01-26 16:37:16 UTC
I'm a bit confused as to why gnome-settings-daemon has to pretend to implement
org.freedesktop.ScreenSaver functionality that it doesn't support, specifically Lock, GetActive, the ActiveChanged signal, etc... Meanwhile, this functionality does exist in org.gnome.ScreenSaver. It would be nice to have this functionality available in a desktop-environment-agnostic way.

Sample use case:
I'm developing an application that tracks user sleep patterns by locking the screen and hibernating when the user goes to sleep, and logging when the user wakes up. I can get this functionality in Gnome from org.gnome.ScreenSaver with Lock and ActiveChanged, but KDE seems to have the same features in org.freedesktop.ScreenSaver. Is there a good reason why these shouldn't be unified in org.freedesktop.ScreenSaver ? Possibly by having this proxy handle those calls as well?
Comment 11 Bastien Nocera 2015-01-26 16:52:54 UTC
(In reply to comment #10)
> I'm a bit confused as to why gnome-settings-daemon has to pretend to implement
> org.freedesktop.ScreenSaver functionality that it doesn't support, specifically
> Lock, GetActive, the ActiveChanged signal, etc...

Because the xml file is from KDE's implementation.

> Meanwhile, this functionality
> does exist in org.gnome.ScreenSaver. It would be nice to have this
> functionality available in a desktop-environment-agnostic way.

But only half of it (the inhibition part) has a spec.

> Sample use case:
> I'm developing an application that tracks user sleep patterns by locking the
> screen and hibernating when the user goes to sleep, and logging when the user
> wakes up. I can get this functionality in Gnome from org.gnome.ScreenSaver with
> Lock and ActiveChanged, but KDE seems to have the same features in
> org.freedesktop.ScreenSaver. Is there a good reason why these shouldn't be
> unified in org.freedesktop.ScreenSaver ? Possibly by having this proxy handle
> those calls as well?

You'll need to work at the XDG level to extend whatever specification this best fits into, and implement that either in KDE or GNOME, and I'm sure the other desktops will follow suit.
Comment 12 daryl5 2015-01-26 17:32:51 UTC
(In reply to comment #11)

> Because the xml file is from KDE's implementation.

Apologies if this is ignorant, but I don't understand this. Doesn't lying about what the interface will do defeat the prupose of introspection?
Comment 13 Bastien Nocera 2015-01-26 18:20:11 UTC
(In reply to comment #12)
> (In reply to comment #11)
> 
> > Because the xml file is from KDE's implementation.
> 
> Apologies if this is ignorant, but I don't understand this. Doesn't lying about
> what the interface will do defeat the prupose of introspection?

Slightly. Though I'll argue that it stops applications behaving badly when the interface is present but not the method. I'd be fine with removing those stubs and rightfully blame the applications for not error-checking properly, but it certainly wouldn't solve your problem.