Make windows resizable if we're about to maximize them programmatically

This commit is contained in:
Sam Lantinga
2024-12-21 08:19:31 -08:00
parent 34974d4d2b
commit 7e298f50fe

View File

@@ -2473,11 +2473,17 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
SDL_Window *window = SDL_GetWindowFromEvent(event);
if (window) {
SDL_WindowFlags flags = SDL_GetWindowFlags(window);
if (!(flags & SDL_WINDOW_RESIZABLE)) {
SDL_SetWindowResizable(window, true);
}
if (flags & SDL_WINDOW_MAXIMIZED) {
SDL_RestoreWindow(window);
} else {
SDL_MaximizeWindow(window);
}
if (!(flags & SDL_WINDOW_RESIZABLE)) {
SDL_SetWindowResizable(window, false);
}
}
}
if (withShift) {