summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-13 07:00:59 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-13 07:00:59 +0200
commitc273ca3ea79d8badd92e9704453d7306e0d85739 (patch)
tree397071e98d18f14124cd68ee1187389b076b8e48 /src/app.c
parent9cdf86dc8dda0ebf777dfdec5c1eeef53371a1ee (diff)
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.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c6
1 files changed, 4 insertions, 2 deletions
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) {
859 case SDL_APP_LOWMEMORY: 859 case SDL_APP_LOWMEMORY:
860 clearCache_App_(); 860 clearCache_App_();
861 break; 861 break;
862 case SDL_APP_WILLENTERFOREGROUND: 862 case SDL_APP_DIDENTERFOREGROUND:
863 postRefresh_App(); 863 postRefresh_App();
864 break; 864 break;
865 case SDL_APP_TERMINATING:
866 case SDL_APP_WILLENTERBACKGROUND: 865 case SDL_APP_WILLENTERBACKGROUND:
866 case SDL_APP_TERMINATING:
867 savePrefs_App_(d); 867 savePrefs_App_(d);
868 saveState_App_(d); 868 saveState_App_(d);
869 break; 869 break;
@@ -1023,7 +1023,9 @@ static int run_App_(iApp *d) {
1023 arrange_Widget(findWidget_App("root")); 1023 arrange_Widget(findWidget_App("root"));
1024 d->isRunning = iTrue; 1024 d->isRunning = iTrue;
1025 SDL_EventState(SDL_DROPFILE, SDL_ENABLE); /* open files via drag'n'drop */ 1025 SDL_EventState(SDL_DROPFILE, SDL_ENABLE); /* open files via drag'n'drop */
1026#if defined (iPlatformDesktop)
1026 SDL_AddEventWatch(resizeWatcher_, d); 1027 SDL_AddEventWatch(resizeWatcher_, d);
1028#endif
1027 while (d->isRunning) { 1029 while (d->isRunning) {
1028 processEvents_App(waitForNewEvents_AppEventMode); 1030 processEvents_App(waitForNewEvents_AppEventMode);
1029 runTickers_App_(d); 1031 runTickers_App_(d);