From ab912fffb1b98c594280417a75ba3f11e537153c Mon Sep 17 00:00:00 2001 From: Ruari O'Sullivan Date: Sat, 28 Nov 2015 00:23:39 +0000 Subject: [PATCH] Use XRandR and Xinerama to get display info Linux specific. Solves a problem with fullscreen behaviour on multiple-monitor systems. On Linux, default X11 behaviour seems to describe multiple monitors as a single virtual display (stretched across all physical monitors), so for example it might describe a pair of 1920x1080 monitors as a single 3840x1080 display. Full-screen SDL windows will therefore attempt to cover that 3840x1080 area and stretch across all displays instead of expanding to a single physical screen as they do on Windows and OS X. SDL_x11modes.c appears to rely on XRandR (or possibly Xinerama) to get information on distinct screens within that virtual display. After enabling both here, fullscreen windows in Linux correctly take full screen on a single monitor. Compiling requires additional packages libxrandr-dev, libxinerama-dev and a -clean build. --- include/configs/linux/SDL_config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/configs/linux/SDL_config.h b/include/configs/linux/SDL_config.h index 0cb03b2f7..a2d1c9b09 100644 --- a/include/configs/linux/SDL_config.h +++ b/include/configs/linux/SDL_config.h @@ -273,16 +273,16 @@ #define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6" /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR */ -/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA */ +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "libXinerama.so.1" #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "libXi.so.6" -/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR */ +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "libXrandr.so.2" /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */ /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE */ /* #undef SDL_VIDEO_DRIVER_X11_XCURSOR */ -/* #undef SDL_VIDEO_DRIVER_X11_XINERAMA */ +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 #define SDL_VIDEO_DRIVER_X11_XINPUT2 NATIVE_TOOLKIT_SDL_X11_XINPUT2 #define SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH NATIVE_TOOLKIT_SDL_X11_XINPUT2_SUPPORTS_MULTITOUCH -/* #undef SDL_VIDEO_DRIVER_X11_XRANDR */ +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 /* #undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER */ #define SDL_VIDEO_DRIVER_X11_XSHAPE 1 /* #undef SDL_VIDEO_DRIVER_X11_XVIDMODE */