Skip to content
Permalink
Browse files

XRandR: fixed primary output detection logic (thanks, "winterknight"!).

Fixes Bugzilla #3185.
  • Loading branch information
icculus committed Dec 29, 2015
1 parent 326b357 commit 18c7d6df213a97dd0ce4a3d68418bb65766a7a65
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/video/x11/SDL_x11modes.c
@@ -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;
}

@@ -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;
}

0 comments on commit 18c7d6d

Please sign in to comment.