[Commits] SDL: Fixed bug 3722 - Fall back to xinerama/xvidmode if xrandr m...

libsdl.org revision control commits-owner at libsdl.org
Wed Aug 2 10:28:15 PDT 2017


details:   https://hg.libsdl.org/SDL/rev/393fa47cb702
changeset: 11177:393fa47cb702
user:      Sam Lantinga <slouken at libsdl.org>
date:      Wed Aug 02 10:28:13 2017 -0700
description:
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).

diffstat:

 src/video/x11/SDL_x11modes.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r 9397a2d41d6b -r 393fa47cb702 src/video/x11/SDL_x11modes.c
--- a/src/video/x11/SDL_x11modes.c	Wed Aug 02 10:24:47 2017 -0700
+++ b/src/video/x11/SDL_x11modes.c	Wed Aug 02 10:28:13 2017 -0700
@@ -604,7 +604,8 @@
     /* 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 */
 


More information about the commits mailing list