From 523c820bfaa6b51498342107942ef9bb1c050e0d Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Tue, 7 Apr 2026 19:54:20 +0200 Subject: [PATCH] Avoid double-rendering on resize On Windows and macOS, resizing the window with the mouse blocks the event loop until the click is released. To keep rendering during resizing, an event watcher is registered to handle resize events. Avoid handling resize events twice by ensuring `SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED` is processed only once. PR #6758 --- app/src/screen.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/screen.c b/app/src/screen.c index 259856cb..71eee81f 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -935,9 +935,12 @@ sc_screen_handle_event(struct sc_screen *screen, const SDL_Event *event) { case SDL_EVENT_WINDOW_EXPOSED: sc_screen_render(screen, true); return; +// If defined, then the actions are already performed by the event watcher +#ifndef CONTINUOUS_RESIZING_WORKAROUND case SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED: sc_screen_on_resize(screen); return; +#endif case SDL_EVENT_WINDOW_RESTORED: if (screen->video && is_windowed(screen)) { apply_pending_resize(screen);