src/video/x11/SDL_x11modes.c
changeset 11454 f6b9e7bd038a
parent 11344 039ef928e200
child 11689 64ec7aae69e3
     1.1 --- a/src/video/x11/SDL_x11modes.c	Mon Sep 04 23:10:12 2017 -0700
     1.2 +++ b/src/video/x11/SDL_x11modes.c	Tue Sep 05 08:24:38 2017 -0700
     1.3 @@ -396,9 +396,16 @@
     1.4                  X11_XFree(pixmapformats);
     1.5              }
     1.6  
     1.7 -            res = X11_XRRGetScreenResources(dpy, RootWindow(dpy, screen));
     1.8 -            if (!res) {
     1.9 -                continue;
    1.10 +            res = X11_XRRGetScreenResourcesCurrent(dpy, RootWindow(dpy, screen));
    1.11 +            if (!res || res->noutput == 0) {
    1.12 +                if (res) {
    1.13 +                    X11_XRRFreeScreenResources(res);
    1.14 +                }
    1.15 +
    1.16 +                res = X11_XRRGetScreenResources(dpy, RootWindow(dpy, screen));
    1.17 +                if (!res) {
    1.18 +                    continue;
    1.19 +                }
    1.20              }
    1.21  
    1.22              for (output = 0; output < res->noutput; output++) {