From 2f1ae3febab7e25b2ecf020b248c26add6792cf6 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 1 Apr 2010 18:22:56 +0200 Subject: [PATCH] Make use of the XScreenSaver extension optional The extension is only needed for the --inactivity-reset option, so most users building Midori won't need it. We also need to check for the according header file. --- midori/main.c | 6 +++--- wscript | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/midori/main.c b/midori/main.c index d0e7e64e..47a3ba3a 100644 --- a/midori/main.c +++ b/midori/main.c @@ -54,7 +54,7 @@ #define BOOKMARK_FILE "bookmarks.xbel" #endif -#ifdef GDK_WINDOWING_X11 +#ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H #include #include #include @@ -1438,7 +1438,7 @@ typedef struct { static gboolean midori_inactivity_timeout (gpointer data) { - #ifdef GDK_WINDOWING_X11 + #ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H MidoriInactivityTimeout* mit = data; static Display* xdisplay = NULL; static XScreenSaverInfo* mit_info = NULL; @@ -1532,7 +1532,7 @@ main (int argc, N_("Display program version"), NULL }, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &uris, N_("Addresses"), NULL }, - #ifdef GDK_WINDOWING_X11 + #ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H { "inactivity-reset", 'i', 0, G_OPTION_ARG_INT, &inactivity_reset, N_("Reset Midori after SECONDS seconds of inactivity"), N_("SECONDS") }, #endif diff --git a/wscript b/wscript index e5d682aa..a64c9bf2 100644 --- a/wscript +++ b/wscript @@ -209,7 +209,8 @@ def configure (conf): args = '--define-variable=target=win32' elif sys.platform != 'darwin': check_pkg ('x11') - conf.check (lib='Xss', mandatory=True) + conf.check (header_name='X11/extensions/scrnsaver.h', mandatory=False) + conf.check (lib='Xss', mandatory=False) check_pkg ('gtk+-2.0', '2.10.0', var='GTK', args=args) check_pkg ('webkit-1.0', '1.1.1', args=args) check_pkg ('libsoup-2.4', '2.25.2') -- 2.39.5