From c2b767db9385db0aedb1311f4212e7f4aa9441ec Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 9 Apr 2021 12:54:28 +0300 Subject: Mobile: Freeze UI draws when app hidden Maybe a workaround for the squished view issue? --- src/ui/window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ui/window.c') diff --git a/src/ui/window.c b/src/ui/window.c index 032d68d1..aa854c72 100644 --- a/src/ui/window.c +++ b/src/ui/window.c @@ -1755,11 +1755,14 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) { d->isExposed = iTrue; /* no expose event is sent, so now we know it's visible */ /* Returned to foreground, may have lost buffered content. */ invalidate_Window_(d); - postRefresh_App(); + postCommand_App("window.unfreeze"); #endif return iFalse; case SDL_WINDOWEVENT_FOCUS_LOST: postCommand_App("window.focus.lost"); +#if defined (iPlatformMobile) + setFreezeDraw_Window(d, iTrue); +#endif return iFalse; case SDL_WINDOWEVENT_TAKE_FOCUS: SDL_SetWindowInputFocus(d->win); -- cgit v1.2.3