Skip to content

Commit 1c7bf47

Browse files
committed
x11: Ignore BadValue for extremely small XRRSetScreenSize resolutions.
Reference Issue #4840.
1 parent db71899 commit 1c7bf47

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/video/x11/SDL_x11modes.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,13 @@ static int (*PreXRRSetScreenSizeErrorHandler)(Display *, XErrorEvent *) = NULL;
10111011
static int
10121012
SDL_XRRSetScreenSizeErrHandler(Display *d, XErrorEvent *e)
10131013
{
1014-
return (e->error_code == BadMatch) ? 0 : PreXRRSetScreenSizeErrorHandler(d, e);
1014+
/* BadMatch: https://github.com/libsdl-org/SDL/issues/4561 */
1015+
/* BadValue: https://github.com/libsdl-org/SDL/issues/4840 */
1016+
if ((e->error_code == BadMatch) || (e->error_code == BadValue)) {
1017+
return 0;
1018+
}
1019+
1020+
return PreXRRSetScreenSizeErrorHandler(d, e);
10151021
}
10161022

10171023
int

0 commit comments

Comments
 (0)