Add support for the freedesktop.org Idle Inhibition specification,

as per:
http://people.freedesktop.org/~hadess/idle-inhibition-spec/

This makes screensaver inhibition work with GNOME 3 and other
desktop environments that implement the specification.

https://bugzilla.libsdl.org/show_bug.cgi?id=2169

--HG--
extra : rebase_source : b1967a91febdaa3f0fcb311ee1909a741722e9b2
This commit is contained in:
Bastien Nocera 2014-03-02 14:59:06 -05:00
parent bb993d3a3b
commit baf56fe069
3 changed files with 90 additions and 6 deletions

View file

@ -1029,7 +1029,19 @@ X11_SuspendScreenSaver(_THIS)
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
int dummy;
int major_version, minor_version;
#endif /* SDL_VIDEO_DRIVER_X11_XSCRNSAVER */
#if SDL_USE_LIBDBUS
if (SDL_dbus_screensaver_inhibit(_this)) {
return;
}
if (_this->suspend_screensaver) {
SDL_dbus_screensaver_tickle(_this);
}
#endif
#if SDL_VIDEO_DRIVER_X11_XSCRNSAVER
if (SDL_X11_HAVE_XSS) {
/* X11_XScreenSaverSuspend was introduced in MIT-SCREEN-SAVER 1.1 */
if (!X11_XScreenSaverQueryExtension(data->display, &dummy, &dummy) ||
@ -1043,12 +1055,6 @@ X11_SuspendScreenSaver(_THIS)
X11_XResetScreenSaver(data->display);
}
#endif
#if SDL_USE_LIBDBUS
if (_this->suspend_screensaver) {
SDL_dbus_screensaver_tickle(_this);
}
#endif
}
#endif /* SDL_VIDEO_DRIVER_X11 */