From 00718d60d2218c9872bf48f03c78889263d6e786 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Tue, 23 Sep 2025 11:30:21 -0400 Subject: [PATCH] x11: Use the pending size for the min/max limits if a resize is in flight Otherwise, an outdated size may be used, reverting the requested resize operation. (cherry picked from commit 45480f5fe507fdd29ec773a68f1ed19566c7a161) --- src/video/x11/SDL_x11window.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index b6a9a8818b..0d2876c5a1 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1226,8 +1226,13 @@ void X11_SetWindowMinMax(SDL_Window *window, bool use_current) } else { // Set the min/max to the same values to make the window non-resizable sizehints->flags |= PMinSize | PMaxSize; - sizehints->min_width = sizehints->max_width = use_current ? data->window->floating.w : window->windowed.w; - sizehints->min_height = sizehints->max_height = use_current ? data->window->floating.h : window->windowed.h; + if (use_current) { + sizehints->min_width = sizehints->max_width = window->last_size_pending ? window->pending.w : data->window->floating.w; + sizehints->min_height = sizehints->max_height = window->last_size_pending ? window->pending.h : data->window->floating.h; + } else { + sizehints->min_width = sizehints->max_width = window->last_size_pending ? window->pending.w : data->window->windowed.w; + sizehints->min_height = sizehints->max_height = window->last_size_pending ? window->pending.h : data->window->windowed.h; + } } X11_XSetWMNormalHints(display, data->xwindow, sizehints);