From 0564cbc4834871066b951fadc1a7a5e1b92aeccf Mon Sep 17 00:00:00 2001 From: Hyper <34012267+hyperbx@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:44:37 +0000 Subject: [PATCH] window: exit fullscreen on F2 reset --- UnleashedRecomp/config_detail.h | 6 +++--- UnleashedRecomp/ui/window.cpp | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/UnleashedRecomp/config_detail.h b/UnleashedRecomp/config_detail.h index ac91bc0..e9bf6d1 100644 --- a/UnleashedRecomp/config_detail.h +++ b/UnleashedRecomp/config_detail.h @@ -251,9 +251,9 @@ enum class EWindowState : uint32_t CONFIG_DEFINE_ENUM_TEMPLATE(EWindowState) { - { "Normal", EWindowState::Normal }, - { "Maximised", EWindowState::Maximised }, - { "Maximized", EWindowState::Maximised } + { "Normal", EWindowState::Normal }, + { "Maximised", EWindowState::Maximised }, + { "Maximized", EWindowState::Maximised } }; enum class EShadowResolution : int32_t diff --git a/UnleashedRecomp/ui/window.cpp b/UnleashedRecomp/ui/window.cpp index 83bbbff..3727f0e 100644 --- a/UnleashedRecomp/ui/window.cpp +++ b/UnleashedRecomp/ui/window.cpp @@ -37,6 +37,7 @@ int Window_OnSDLEvent(void*, SDL_Event* event) // Restore original window dimensions on F2. case SDLK_F2: + Config::Fullscreen = Window::SetFullscreen(false); Window::SetDimensions(SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, DEFAULT_WIDTH, DEFAULT_HEIGHT); break; }