From 7bb8344d3b4b09a449e0f8eea4e2f96be065e235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Thu, 5 Oct 2023 21:22:25 +0200 Subject: [PATCH] Fix the Maximized property of windows shortcuts not being respected By not resizing the window if it's resizeable and is somehow already maximized. --- src/PowderToySDL.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index bb7428d2a..45b4b1ae8 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -255,10 +255,12 @@ void SDLSetScreen() //SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); //SDL_SetWindowResizable(sdl_window, SDL_TRUE); } - - SDL_SetWindowSize(sdl_window, size.X, size.Y); SDL_RenderSetIntegerScale(sdl_renderer, newFrameOpsNorm.forceIntegerScaling ? SDL_TRUE : SDL_FALSE); - LoadWindowPosition(); + if (!(newFrameOpsNorm.resizable && SDL_GetWindowFlags(sdl_window) & SDL_WINDOW_MAXIMIZED)) + { + SDL_SetWindowSize(sdl_window, size.X, size.Y); + LoadWindowPosition(); + } UpdateFpsLimit(); if (newFrameOpsNorm.fullscreen) {