From c273ca3ea79d8badd92e9704453d7306e0d85739 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sat, 13 Mar 2021 07:00:59 +0200 Subject: Mobile: Simplified window event handling The desktop window events do things that are not relevant on mobile, and may in fact be harmful. Since mobile is essentially fullscreen only, needed updates to root size are done whenever the window is redrawn. --- src/app.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index 16cf14d4..9e00c408 100644 --- a/src/app.c +++ b/src/app.c @@ -859,11 +859,11 @@ void processEvents_App(enum iAppEventMode eventMode) { case SDL_APP_LOWMEMORY: clearCache_App_(); break; - case SDL_APP_WILLENTERFOREGROUND: + case SDL_APP_DIDENTERFOREGROUND: postRefresh_App(); break; - case SDL_APP_TERMINATING: case SDL_APP_WILLENTERBACKGROUND: + case SDL_APP_TERMINATING: savePrefs_App_(d); saveState_App_(d); break; @@ -1023,7 +1023,9 @@ static int run_App_(iApp *d) { arrange_Widget(findWidget_App("root")); d->isRunning = iTrue; SDL_EventState(SDL_DROPFILE, SDL_ENABLE); /* open files via drag'n'drop */ +#if defined (iPlatformDesktop) SDL_AddEventWatch(resizeWatcher_, d); +#endif while (d->isRunning) { processEvents_App(waitForNewEvents_AppEventMode); runTickers_App_(d); -- cgit v1.2.3