Skip to content

Commit

Permalink
XRandR: fixed primary output detection logic (thanks, "winterknight"!).
Browse files Browse the repository at this point in the history
Fixes Bugzilla #3185.
  • Loading branch information
icculus committed Dec 29, 2015
1 parent 326b357 commit 18c7d6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/video/x11/SDL_x11modes.c
Expand Up @@ -376,8 +376,7 @@ X11_InitModes_XRandR(_THIS)
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;
}

Expand Down Expand Up @@ -421,7 +420,7 @@ X11_InitModes_XRandR(_THIS)
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;
}
Expand Down

0 comments on commit 18c7d6d

Please sign in to comment.