diff options
author | Stefano Karapetsas <[email protected]> | 2013-11-12 16:50:44 +0100 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2013-11-12 16:50:44 +0100 |
commit | d5027c1631b5db4197f9d3a6aa518ce0265ac05f (patch) | |
tree | cf5bcdc0b965a1a1f803bbd704300ef51255cb8f /src/gs-watcher-x11.c | |
parent | fa5f117527e6674168ef613b5e50190fa08d9e26 (diff) | |
download | mate-screensaver-d5027c1631b5db4197f9d3a6aa518ce0265ac05f.tar.bz2 mate-screensaver-d5027c1631b5db4197f9d3a6aa518ce0265ac05f.tar.xz |
Add GTK3 support
Diffstat (limited to 'src/gs-watcher-x11.c')
-rw-r--r-- | src/gs-watcher-x11.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gs-watcher-x11.c b/src/gs-watcher-x11.c index 39c10a6..5f699f1 100644 --- a/src/gs-watcher-x11.c +++ b/src/gs-watcher-x11.c @@ -28,6 +28,7 @@ #include <errno.h> #include <string.h> +#include <gtk/gtk.h> #include <gdk/gdkx.h> #include <dbus/dbus.h> @@ -591,7 +592,11 @@ disable_builtin_screensaver (GSWatcher *watcher, int desired_server_timeout, desired_server_interval; int desired_prefer_blank, desired_allow_exp; +#if GTK_CHECK_VERSION (3, 0, 0) + XGetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), +#else XGetScreenSaver (GDK_DISPLAY (), +#endif ¤t_server_timeout, ¤t_server_interval, ¤t_prefer_blank, @@ -630,19 +635,31 @@ disable_builtin_screensaver (GSWatcher *watcher, (desired_prefer_blank ? "blank" : "noblank"), (desired_allow_exp ? "expose" : "noexpose")); +#if GTK_CHECK_VERSION (3, 0, 0) + XSetScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), +#else XSetScreenSaver (GDK_DISPLAY (), +#endif desired_server_timeout, desired_server_interval, desired_prefer_blank, desired_allow_exp); +#if GTK_CHECK_VERSION (3, 0, 0) + XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), FALSE); +#else XSync (GDK_DISPLAY (), FALSE); +#endif } if (unblank_screen) { /* Turn off the server builtin saver if it is now running. */ +#if GTK_CHECK_VERSION (3, 0, 0) + XForceScreenSaver (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), ScreenSaverReset); +#else XForceScreenSaver (GDK_DISPLAY (), ScreenSaverReset); +#endif } } |