Get the correct screen bounds from xinerama
authorSam Lantinga <slouken@libsdl.org>
Fri, 28 Sep 2012 14:22:18 -0700
changeset 6506 305f0fcc0e99
parent 6505 ce7abf273d8c
child 6507 42acda949dfb
Get the correct screen bounds from xinerama
src/video/x11/SDL_x11modes.c
src/video/x11/SDL_x11modes.h
--- a/src/video/x11/SDL_x11modes.c	Fri Sep 28 14:21:15 2012 -0700
+++ b/src/video/x11/SDL_x11modes.c	Fri Sep 28 14:22:18 2012 -0700
@@ -217,6 +217,7 @@
             displaydata->screen = 0;
             displaydata->use_xinerama = xinerama_major * 100 + xinerama_minor;
             displaydata->xinerama_info = xinerama[screen];
+            displaydata->xinerama_screen = screen;
         }
         else displaydata->screen = screen;
 #else
@@ -642,8 +643,8 @@
 
         /* Update the current screen layout information */
         xinerama = XineramaQueryScreens(display, &screencount);
-        if (xinerama && data->screen < screencount) {
-            data->xinerama_info = xinerama[data->screen];
+        if (xinerama && data->xinerama_screen < screencount) {
+            data->xinerama_info = xinerama[data->xinerama_screen];
         }
         if (xinerama) XFree(xinerama);
 
--- a/src/video/x11/SDL_x11modes.h	Fri Sep 28 14:21:15 2012 -0700
+++ b/src/video/x11/SDL_x11modes.h	Fri Sep 28 14:22:18 2012 -0700
@@ -36,6 +36,7 @@
 
 #if SDL_VIDEO_DRIVER_X11_XINERAMA
     XineramaScreenInfo xinerama_info;
+    int xinerama_screen;
 #endif
 #if SDL_VIDEO_DRIVER_X11_XRANDR
     XRRScreenConfiguration *screen_config;