diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index c1efe243c..f2cbdb45f 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -1011,7 +1011,13 @@ static int (*PreXRRSetScreenSizeErrorHandler)(Display *, XErrorEvent *) = NULL; static int SDL_XRRSetScreenSizeErrHandler(Display *d, XErrorEvent *e) { - return (e->error_code == BadMatch) ? 0 : PreXRRSetScreenSizeErrorHandler(d, e); + /* BadMatch: https://github.com/libsdl-org/SDL/issues/4561 */ + /* BadValue: https://github.com/libsdl-org/SDL/issues/4840 */ + if ((e->error_code == BadMatch) || (e->error_code == BadValue)) { + return 0; + } + + return PreXRRSetScreenSizeErrorHandler(d, e); } int