XRandR: fixed primary output detection logic (thanks, "winterknight"!).
authorRyan C. Gordon <icculus@icculus.org>
Tue, 29 Dec 2015 02:16:14 -0500
changeset 9984 df034dc2f547
parent 9983 bbe9ef8c2ecb
child 9985 091503bd5054
XRandR: fixed primary output detection logic (thanks, "winterknight"!). Fixes Bugzilla #3185.
src/video/x11/SDL_x11modes.c
--- a/src/video/x11/SDL_x11modes.c	Tue Dec 29 01:09:58 2015 -0500
+++ b/src/video/x11/SDL_x11modes.c	Tue Dec 29 02:16:14 2015 -0500
@@ -376,8 +376,7 @@
         for (screen = 0; screen < screencount; screen++) {
 
             /* we want the primary output first, and then skipped later. */
-            if ((looking_for_primary && (screen != default_screen)) ||
-                (!looking_for_primary && (screen == default_screen))) {
+            if (looking_for_primary && (screen != default_screen)) {
                 continue;
             }
 
@@ -421,7 +420,7 @@
                 XRRCrtcInfo *crtc;
 
                 /* The primary output _should_ always be sorted first, but just in case... */
-                if ((looking_for_primary && ((screen != default_screen) || (res->outputs[output] != primary))) ||
+                if ((looking_for_primary && (res->outputs[output] != primary)) ||
                     (!looking_for_primary && (screen == default_screen) && (res->outputs[output] == primary))) {
                     continue;
                 }