Browse Source

Fixed XSync sequence to match other cases where we set the X11 error handler

Sam Lantinga 4 years ago
parent
commit
b033cd0d2e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/video/x11/SDL_x11modes.c

+ 2 - 1
src/video/x11/SDL_x11modes.c

@@ -1057,9 +1057,10 @@ X11_SetDisplayMode(_THIS, SDL_VideoDisplay * sdl_display, SDL_DisplayMode * mode
            for now we cheat and just catch the X11 error and carry on, which
            for now we cheat and just catch the X11 error and carry on, which
            is likely to cause subtle issues but is better than outright
            is likely to cause subtle issues but is better than outright
            crashing */
            crashing */
+        X11_XSync(display, False);
         PreXRRSetScreenSizeErrorHandler = X11_XSetErrorHandler(SDL_XRRSetScreenSizeErrHandler);
         PreXRRSetScreenSizeErrorHandler = X11_XSetErrorHandler(SDL_XRRSetScreenSizeErrHandler);
         X11_XRRSetScreenSize(display, RootWindow(display, data->screen), mode->w, mode->h, mm_width, mm_height);
         X11_XRRSetScreenSize(display, RootWindow(display, data->screen), mode->w, mode->h, mm_width, mm_height);
-        X11_XSync(display, False);  /* hopefully force any protocol errors to process with this handler. */
+        X11_XSync(display, False);
         X11_XSetErrorHandler(PreXRRSetScreenSizeErrorHandler);
         X11_XSetErrorHandler(PreXRRSetScreenSizeErrorHandler);
 
 
         status = X11_XRRSetCrtcConfig (display, res, output_info->crtc, CurrentTime,
         status = X11_XRRSetCrtcConfig (display, res, output_info->crtc, CurrentTime,