summaryrefslogtreecommitdiff
path: root/src/gs-watcher-x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gs-watcher-x11.c')
-rw-r--r--src/gs-watcher-x11.c17
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
&current_server_timeout,
&current_server_interval,
&current_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
}
}