From ff2ee9db1de3c44aa5b185477bd12e9a847bc5e0 Mon Sep 17 00:00:00 2001 From: Susko3 Date: Mon, 25 Nov 2024 12:31:42 +0000 Subject: [PATCH] Don't store windowed size to config from event watch --- osu.Framework/Platform/SDL3/SDL3Window.cs | 2 +- osu.Framework/Platform/SDL3/SDL3Window_Windowing.cs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Framework/Platform/SDL3/SDL3Window.cs b/osu.Framework/Platform/SDL3/SDL3Window.cs index bb03b60937..33e509828f 100644 --- a/osu.Framework/Platform/SDL3/SDL3Window.cs +++ b/osu.Framework/Platform/SDL3/SDL3Window.cs @@ -316,7 +316,7 @@ protected void HandleEventFromWatch(SDL_Event evt) case SDL_EventType.SDL_EVENT_WINDOW_RESIZED: // polling via SDL_PollEvent blocks on resizes (https://stackoverflow.com/a/50858339) if (!updatingWindowStateAndSize) - fetchWindowSize(); + fetchWindowSize(storeToConfig: false); break; } diff --git a/osu.Framework/Platform/SDL3/SDL3Window_Windowing.cs b/osu.Framework/Platform/SDL3/SDL3Window_Windowing.cs index c3622b6b06..42b79980dc 100644 --- a/osu.Framework/Platform/SDL3/SDL3Window_Windowing.cs +++ b/osu.Framework/Platform/SDL3/SDL3Window_Windowing.cs @@ -444,7 +444,7 @@ private unsafe Rectangle windowDisplayBounds /// Updates and according to SDL state. /// /// Whether the window size has been changed after updating. - private unsafe void fetchWindowSize() + private unsafe void fetchWindowSize(bool storeToConfig = true) { int w, h; SDL_GetWindowSize(SDLWindowHandle, &w, &h); @@ -459,7 +459,8 @@ private unsafe void fetchWindowSize() Scale = (float)drawableW / w; Size = new Size(w, h); - storeWindowSizeToConfig(); + if (storeToConfig) + storeWindowSizeToConfig(); } #region SDL Event Handling