https://github.com/libsdl-org/SDL/commit/037cd25a2266ee757868c3c3fd5eea4217c7667c
From 037cd25a2266ee757868c3c3fd5eea4217c7667c Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Thu, 9 Jan 2025 11:48:51 -0500
Subject: [PATCH] win32: Use the pending size during NCCALCSIZE
Non-resizable windows still need to apply the pending size, as they can be resized programmatically.
Fixes programmatically resizing windows without the WS_THICKFRAME style.
---
src/video/windows/SDL_windowsevents.c | 11 ++++++++---
src/video/windows/SDL_windowswindow.c | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c
index 95b208c25b676..9360857816d91 100644
--- a/src/video/windows/SDL_windowsevents.c
+++ b/src/video/windows/SDL_windowsevents.c
@@ -2020,10 +2020,15 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
params->rgrc[0] = info.rcWork;
}
}
- } else if (!(window_flags & SDL_WINDOW_RESIZABLE)) {
+ } else if (!(window_flags & SDL_WINDOW_RESIZABLE) && !data->force_resizable) {
int w, h;
- w = data->window->floating.w;
- h = data->window->floating.h;
+ if (data->window->last_size_pending) {
+ w = data->window->pending.w;
+ h = data->window->pending.h;
+ } else {
+ w = data->window->floating.w;
+ h = data->window->floating.h;
+ }
params->rgrc[0].right = params->rgrc[0].left + w;
params->rgrc[0].bottom = params->rgrc[0].top + h;
}
diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c
index 77c9a139ffd8b..68e65847e62d0 100644
--- a/src/video/windows/SDL_windowswindow.c
+++ b/src/video/windows/SDL_windowswindow.c
@@ -162,7 +162,7 @@ static DWORD GetWindowStyle(SDL_Window *window)
DWORD style = 0;
if (SDL_WINDOW_IS_POPUP(window)) {
- style |= WS_POPUP | WS_THICKFRAME;
+ style |= WS_POPUP;
} else if (window->flags & SDL_WINDOW_FULLSCREEN) {
style |= STYLE_FULLSCREEN;
} else {