From a67ae8eed57f4545c739e6eb3a4b8c1169d3afbc Mon Sep 17 00:00:00 2001
From: Le Philousophe <[EMAIL REDACTED]>
Date: Sat, 18 Feb 2023 18:21:09 +0100
Subject: [PATCH] Fix window size in X11 when window manager refuses to resize
---
src/video/x11/SDL_x11window.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c
index 4274d8acc6a2..9c5a8b34e9b3 100644
--- a/src/video/x11/SDL_x11window.c
+++ b/src/video/x11/SDL_x11window.c
@@ -997,6 +997,10 @@ void X11_SetWindowSize(_THIS, SDL_Window *window)
}
if (SDL_GetTicks() >= timeout) {
+ /* Timeout occurred and window size didn't change
+ * wwindow manager likely denied the resize. */
+ window->w = orig_w;
+ window->h = orig_h;
break;
}