Make windows resizable if we're about to maximize them programmatically
This commit is contained in:
@@ -2473,11 +2473,17 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
|||||||
SDL_Window *window = SDL_GetWindowFromEvent(event);
|
SDL_Window *window = SDL_GetWindowFromEvent(event);
|
||||||
if (window) {
|
if (window) {
|
||||||
SDL_WindowFlags flags = SDL_GetWindowFlags(window);
|
SDL_WindowFlags flags = SDL_GetWindowFlags(window);
|
||||||
|
if (!(flags & SDL_WINDOW_RESIZABLE)) {
|
||||||
|
SDL_SetWindowResizable(window, true);
|
||||||
|
}
|
||||||
if (flags & SDL_WINDOW_MAXIMIZED) {
|
if (flags & SDL_WINDOW_MAXIMIZED) {
|
||||||
SDL_RestoreWindow(window);
|
SDL_RestoreWindow(window);
|
||||||
} else {
|
} else {
|
||||||
SDL_MaximizeWindow(window);
|
SDL_MaximizeWindow(window);
|
||||||
}
|
}
|
||||||
|
if (!(flags & SDL_WINDOW_RESIZABLE)) {
|
||||||
|
SDL_SetWindowResizable(window, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (withShift) {
|
if (withShift) {
|
||||||
|
|||||||
Reference in New Issue
Block a user