From 18c7d6df213a97dd0ce4a3d68418bb65766a7a65 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 29 Dec 2015 02:16:14 -0500 Subject: [PATCH] XRandR: fixed primary output detection logic (thanks, "winterknight"!). Fixes Bugzilla #3185. --- src/video/x11/SDL_x11modes.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index d213636479780..0c31e35e972a1 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/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; }