Add HAVE_XINERAMA ifdefs

This commit is contained in:
twinaphex 2017-04-26 15:29:21 +02:00
parent 8a4590462f
commit 301ee64e80
4 changed files with 10 additions and 13 deletions

View File

@ -677,10 +677,8 @@ ifeq ($(HAVE_X11), 1)
input/drivers/x11_input.o \ input/drivers/x11_input.o \
gfx/common/dbus_common.o \ gfx/common/dbus_common.o \
gfx/common/x11_common.o \ gfx/common/x11_common.o \
input/drivers_keyboard/keyboard_event_x11.o input/drivers_keyboard/keyboard_event_x11.o \
ifeq ($(HAVE_XINERAMA), 1) gfx/common/xinerama_common.o
OBJ += gfx/common/xinerama_common.o
endif
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS) LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS)
DEFINES += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS) DEFINES += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)

View File

@ -25,7 +25,6 @@
#ifdef HAVE_XINERAMA #ifdef HAVE_XINERAMA
#include <X11/extensions/Xinerama.h> #include <X11/extensions/Xinerama.h>
#endif
#include "xinerama_common.h" #include "xinerama_common.h"
@ -33,7 +32,6 @@
static XineramaScreenInfo *xinerama_query_screens(Display *dpy, int *num_screens) static XineramaScreenInfo *xinerama_query_screens(Display *dpy, int *num_screens)
{ {
#ifdef HAVE_XINERAMA
int major, minor; int major, minor;
if (!XineramaQueryExtension(dpy, &major, &minor)) if (!XineramaQueryExtension(dpy, &major, &minor))
@ -44,7 +42,6 @@ static XineramaScreenInfo *xinerama_query_screens(Display *dpy, int *num_screens
if (XineramaIsActive(dpy)) if (XineramaIsActive(dpy))
return XineramaQueryScreens(dpy, num_screens); return XineramaQueryScreens(dpy, num_screens);
#endif
return NULL; return NULL;
} }
@ -52,7 +49,6 @@ static XineramaScreenInfo *xinerama_query_screens(Display *dpy, int *num_screens
bool xinerama_get_coord(Display *dpy, int screen, bool xinerama_get_coord(Display *dpy, int screen,
int *x, int *y, unsigned *w, unsigned *h) int *x, int *y, unsigned *w, unsigned *h)
{ {
#ifdef HAVE_XINERAMA
int i, num_screens = 0; int i, num_screens = 0;
XineramaScreenInfo *info = xinerama_query_screens(dpy, &num_screens); XineramaScreenInfo *info = xinerama_query_screens(dpy, &num_screens);
@ -72,7 +68,6 @@ bool xinerama_get_coord(Display *dpy, int screen,
} }
XFree(info); XFree(info);
#endif
return false; return false;
} }
@ -80,7 +75,6 @@ bool xinerama_get_coord(Display *dpy, int screen,
unsigned xinerama_get_monitor(Display *dpy, int x, int y, unsigned xinerama_get_monitor(Display *dpy, int x, int y,
int w, int h) int w, int h)
{ {
#ifdef HAVE_XINERAMA
int i, num_screens = 0; int i, num_screens = 0;
unsigned monitor = 0; unsigned monitor = 0;
int largest_area = 0; int largest_area = 0;
@ -116,14 +110,12 @@ unsigned xinerama_get_monitor(Display *dpy, int x, int y,
if (monitor > 0) if (monitor > 0)
return monitor; return monitor;
#endif
return 0; return 0;
} }
void xinerama_save_last_used_monitor(Window win) void xinerama_save_last_used_monitor(Window win)
{ {
#ifdef HAVE_XINERAMA
XWindowAttributes target; XWindowAttributes target;
Window child; Window child;
int x = 0, y = 0; int x = 0, y = 0;
@ -137,5 +129,6 @@ void xinerama_save_last_used_monitor(Window win)
target.width, target.height); target.width, target.height);
RARCH_LOG("[XINERAMA]: Saved monitor #%u.\n", g_x11_screen); RARCH_LOG("[XINERAMA]: Saved monitor #%u.\n", g_x11_screen);
#endif
} }
#endif

View File

@ -39,7 +39,10 @@
#include "../../frontend/frontend_driver.h" #include "../../frontend/frontend_driver.h"
#include "../common/gl_common.h" #include "../common/gl_common.h"
#include "../common/x11_common.h" #include "../common/x11_common.h"
#ifdef HAVE_XINERAMA
#include "../common/xinerama_common.h" #include "../common/xinerama_common.h"
#endif
#ifdef HAVE_VULKAN #ifdef HAVE_VULKAN
#include "../common/vulkan_common.h" #include "../common/vulkan_common.h"

View File

@ -28,7 +28,10 @@
#include "../common/egl_common.h" #include "../common/egl_common.h"
#include "../common/gl_common.h" #include "../common/gl_common.h"
#include "../common/x11_common.h" #include "../common/x11_common.h"
#ifdef HAVE_XINERAMA
#include "../common/xinerama_common.h" #include "../common/xinerama_common.h"
#endif
#ifndef EGL_OPENGL_ES3_BIT_KHR #ifndef EGL_OPENGL_ES3_BIT_KHR
#define EGL_OPENGL_ES3_BIT_KHR 0x0040 #define EGL_OPENGL_ES3_BIT_KHR 0x0040