From 34c78f70abddefcae6e05502a0a964b0539e62f8 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 22 Jan 2022 14:50:23 +0200 Subject: Window: Don't trigger a draw during SDL_ShowWindow IssueID #442 --- src/ui/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/window.c b/src/ui/window.c index af36bb22..13abc5fa 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1001,10 +1001,11 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { default: { SDL_Event event = *ev; if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze") && mw) { - mw->isDrawFrozen = iFalse; if (SDL_GetWindowFlags(d->win) & SDL_WINDOW_HIDDEN) { + mw->isDrawFrozen = iTrue; /* don't trigger a redraw now */ SDL_ShowWindow(d->win); } + mw->isDrawFrozen = iFalse; draw_MainWindow(mw); /* don't show a frame of placeholder content */ postCommand_App("media.player.update"); /* in case a player needs updating */ return iTrue; -- cgit v1.2.3