Fixed bug where desktop resolution was never restored if Xinerama was enabled.
authorSam Lantinga <slouken@libsdl.org>
Fri, 28 Sep 2012 00:40:47 -0700
changeset 6482 94e3643928ed
parent 6481 fab4b15b17e9
child 6483 4b51ff3dcf74
Fixed bug where desktop resolution was never restored if Xinerama was enabled.
src/video/x11/SDL_x11modes.c
--- a/src/video/x11/SDL_x11modes.c	Thu Sep 27 23:55:38 2012 -0700
+++ b/src/video/x11/SDL_x11modes.c	Fri Sep 28 00:40:47 2012 -0700
@@ -596,15 +596,6 @@
 get_real_resolution(Display * display, SDL_DisplayData * data, int *w, int *h,
                     int *rate)
 {
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    if (data->use_xinerama) {
-        *w = data->xinerama_info.width;
-        *h = data->xinerama_info.height;
-        *rate = 0;
-        return;
-    }
-#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
-
 #if SDL_VIDEO_DRIVER_X11_XRANDR
     if (data->use_xrandr) {
         int nsizes;
@@ -644,6 +635,15 @@
     }
 #endif /* SDL_VIDEO_DRIVER_X11_XVIDMODE */
 
+#if SDL_VIDEO_DRIVER_X11_XINERAMA
+    if (data->use_xinerama) {
+        *w = data->xinerama_info.width;
+        *h = data->xinerama_info.height;
+        *rate = 0;
+        return;
+    }
+#endif /* SDL_VIDEO_DRIVER_X11_XINERAMA */
+
     *w = DisplayWidth(display, data->screen);
     *h = DisplayHeight(display, data->screen);
     *rate = 0;
@@ -658,15 +658,9 @@
     /* check current mode so we can avoid uneccessary mode changes */
     get_real_resolution(display, data, &real_w, &real_h, &real_rate);
 
-#if SDL_VIDEO_DRIVER_X11_XINERAMA
-    if (w == real_w && h == real_h && (data->use_xinerama || !rate || rate == real_rate)) {
+    if (w == real_w && h == real_h && (!rate || !real_rate || rate == real_rate)) {
         return;
     }
-#else
-    if (w == real_w && h == real_h && (!rate || rate == real_rate)) {
-        return;
-    }
-#endif
 
 #if SDL_VIDEO_DRIVER_X11_XRANDR
     if (data->use_xrandr) {