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.
This commit is contained in:
Christian Dywan 2010-04-01 18:22:56 +02:00
parent 497c73b972
commit 2f1ae3feba
2 changed files with 5 additions and 4 deletions

View file

@ -54,7 +54,7 @@
#define BOOKMARK_FILE "bookmarks.xbel" #define BOOKMARK_FILE "bookmarks.xbel"
#endif #endif
#ifdef GDK_WINDOWING_X11 #ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/extensions/scrnsaver.h> #include <X11/extensions/scrnsaver.h>
@ -1438,7 +1438,7 @@ typedef struct {
static gboolean static gboolean
midori_inactivity_timeout (gpointer data) midori_inactivity_timeout (gpointer data)
{ {
#ifdef GDK_WINDOWING_X11 #ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
MidoriInactivityTimeout* mit = data; MidoriInactivityTimeout* mit = data;
static Display* xdisplay = NULL; static Display* xdisplay = NULL;
static XScreenSaverInfo* mit_info = NULL; static XScreenSaverInfo* mit_info = NULL;
@ -1532,7 +1532,7 @@ main (int argc,
N_("Display program version"), NULL }, N_("Display program version"), NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &uris, { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &uris,
N_("Addresses"), NULL }, N_("Addresses"), NULL },
#ifdef GDK_WINDOWING_X11 #ifdef HAVE_X11_EXTENSIONS_SCRNSAVER_H
{ "inactivity-reset", 'i', 0, G_OPTION_ARG_INT, &inactivity_reset, { "inactivity-reset", 'i', 0, G_OPTION_ARG_INT, &inactivity_reset,
N_("Reset Midori after SECONDS seconds of inactivity"), N_("SECONDS") }, N_("Reset Midori after SECONDS seconds of inactivity"), N_("SECONDS") },
#endif #endif

View file

@ -209,7 +209,8 @@ def configure (conf):
args = '--define-variable=target=win32' args = '--define-variable=target=win32'
elif sys.platform != 'darwin': elif sys.platform != 'darwin':
check_pkg ('x11') 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 ('gtk+-2.0', '2.10.0', var='GTK', args=args)
check_pkg ('webkit-1.0', '1.1.1', args=args) check_pkg ('webkit-1.0', '1.1.1', args=args)
check_pkg ('libsoup-2.4', '2.25.2') check_pkg ('libsoup-2.4', '2.25.2')