# SDL: Fix window size in X11 when window manager refuses to resize

**URL:** <https://discourse.libsdl.org/t/sdl-fix-window-size-in-x11-when-window-manager-refuses-to-resize/42653>\
**Category:** SDL Commits\
**Created:** [February 18, 2023, 8:32pm UTC](https://discourse.libsdl.org/t/sdl-fix-window-size-in-x11-when-window-manager-refuses-to-resize/42653 "2023-02-18T20:32:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [February 18, 2023, 8:32pm UTC](https://discourse.libsdl.org/t/sdl-fix-window-size-in-x11-when-window-manager-refuses-to-resize/42653/1 "2023-02-18T20:32:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/a67ae8eed57f4545c739e6eb3a4b8c1169d3afbc>

```diff
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;
         }
 

```
