Skip to content

Commit 037cd25

Browse files
committed
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.
1 parent e8916b2 commit 037cd25

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/video/windows/SDL_windowsevents.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,10 +2020,15 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
20202020
params->rgrc[0] = info.rcWork;
20212021
}
20222022
}
2023-
} else if (!(window_flags & SDL_WINDOW_RESIZABLE)) {
2023+
} else if (!(window_flags & SDL_WINDOW_RESIZABLE) && !data->force_resizable) {
20242024
int w, h;
2025-
w = data->window->floating.w;
2026-
h = data->window->floating.h;
2025+
if (data->window->last_size_pending) {
2026+
w = data->window->pending.w;
2027+
h = data->window->pending.h;
2028+
} else {
2029+
w = data->window->floating.w;
2030+
h = data->window->floating.h;
2031+
}
20272032
params->rgrc[0].right = params->rgrc[0].left + w;
20282033
params->rgrc[0].bottom = params->rgrc[0].top + h;
20292034
}

src/video/windows/SDL_windowswindow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static DWORD GetWindowStyle(SDL_Window *window)
162162
DWORD style = 0;
163163

164164
if (SDL_WINDOW_IS_POPUP(window)) {
165-
style |= WS_POPUP | WS_THICKFRAME;
165+
style |= WS_POPUP;
166166
} else if (window->flags & SDL_WINDOW_FULLSCREEN) {
167167
style |= STYLE_FULLSCREEN;
168168
} else {

0 commit comments

Comments
 (0)