From 082f32d198da8a2a4559a43ed92b9076938b01ee Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 2 Aug 2017 10:28:13 -0700 Subject: [PATCH] Fixed bug 3722 - Fall back to xinerama/xvidmode if xrandr modes initialization fails Levi Bard In some environments, xrandr modes initialization can fail even though xrandr support is present and of a sufficient version. (The one I encountered was an AWS instance running a virtual display) The attached patch allows SDL to keep trying other methods if xrandr modes initialization fails (still subject to SDL_VIDEO_X11_REQUIRE_XRANDR). --- src/video/x11/SDL_x11modes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 5e2e064f90095..887e9ffe82e8b 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -604,7 +604,8 @@ X11_InitModes(_THIS) /* require at least XRandR v1.3 */ if (CheckXRandR(data->display, &xrandr_major, &xrandr_minor) && (xrandr_major >= 2 || (xrandr_major == 1 && xrandr_minor >= 3))) { - return X11_InitModes_XRandR(_this); + if (X11_InitModes_XRandR(_this) == 0) + return 0; } #endif /* SDL_VIDEO_DRIVER_X11_XRANDR */