GNOME Bugzilla – Bug 689225
screensaver-proxy: Add new screesaver proxy plugin
Last modified: 2015-01-26 18:20:11 UTC
Untested, but compiles.
Created attachment 230096 [details] [review] screensaver-proxy: Add new screesaver proxy plugin Proxy the org.freedesktop.ScreenSaver D-Bus API to gnome-session as needed. 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
Created attachment 230100 [details] [review] screensaver-proxy: Add new screesaver proxy plugin Proxy the org.freedesktop.ScreenSaver D-Bus API to gnome-session as needed. 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
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
This would really be a fantastic addition!
BTW, I've pinged MPlayer to let them know they can use the interface: http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1887
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
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 \
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.
Attachment 230106 [details] pushed as e8f032b - screensaver-proxy: Add new screesaver proxy plugin
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?
(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.
(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?
(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.