Make it possible to build lemonbar w/o XINERAMA support

This commit is contained in:
LemonBoy 2016-04-23 08:59:38 +02:00
parent ae5a3a477a
commit a3fb967ad9

View File

@ -11,7 +11,9 @@
#include <errno.h> #include <errno.h>
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/xcbext.h> #include <xcb/xcbext.h>
#if WITH_XINERAMA
#include <xcb/xinerama.h> #include <xcb/xinerama.h>
#endif
#include <xcb/randr.h> #include <xcb/randr.h>
// Here be dragons // Here be dragons
@ -987,6 +989,7 @@ get_randr_monitors (void)
monitor_create_chain(r, valid); monitor_create_chain(r, valid);
} }
#ifdef WITH_XINERAMA
void void
get_xinerama_monitors (void) get_xinerama_monitors (void)
{ {
@ -1015,6 +1018,7 @@ get_xinerama_monitors (void)
monitor_create_chain(rects, screens); monitor_create_chain(rects, screens);
} }
#endif
xcb_visualid_t xcb_visualid_t
get_visual (void) get_visual (void)
@ -1139,7 +1143,9 @@ init (char *wm_name)
if (qe_reply && qe_reply->present) { if (qe_reply && qe_reply->present) {
get_randr_monitors(); get_randr_monitors();
} else { }
#if WITH_XINERAMA
else {
qe_reply = xcb_get_extension_data(c, &xcb_xinerama_id); qe_reply = xcb_get_extension_data(c, &xcb_xinerama_id);
// Check if Xinerama extension is present and active // Check if Xinerama extension is present and active
@ -1153,6 +1159,7 @@ init (char *wm_name)
free(xia_reply); free(xia_reply);
} }
} }
#endif
if (!monhead) { if (!monhead) {
// If I fits I sits // If I fits I sits