summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-01-20 15:15:08 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-01-20 15:15:08 +0200
commit0593bbdf2286e88222316bfd0b5f6b348c60ea73 (patch)
treedb6901ded37d440e15f6a82b4334345ec94b175a /src/app.c
parent6da3bdb612e0ead07ff93f4f6dc5aef46c7b9c9e (diff)
Android: External downloads; Back button handling; bumped version
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index 6392e7fa..a137dc23 100644
--- a/src/app.c
+++ b/src/app.c
@@ -333,7 +333,9 @@ static const char *dataDir_App_(void) {
333 333
334static const char *downloadDir_App_(void) { 334static const char *downloadDir_App_(void) {
335#if defined (iPlatformAndroidMobile) 335#if defined (iPlatformAndroidMobile)
336 return concatPath_CStr(SDL_AndroidGetInternalStoragePath(), "Downloads"); 336 const char *dir = concatPath_CStr(SDL_AndroidGetExternalStoragePath(), "Downloads");
337 makeDirs_Path(collectNewCStr_String(dir));
338 return dir;
337#endif 339#endif
338#if defined (iPlatformLinux) || defined (iPlatformOther) 340#if defined (iPlatformLinux) || defined (iPlatformOther)
339 /* Parse user-dirs.dirs using the `xdg-user-dir` tool. */ 341 /* Parse user-dirs.dirs using the `xdg-user-dir` tool. */
@@ -1391,6 +1393,16 @@ void processEvents_App(enum iAppEventMode eventMode) {
1391 ev.key.keysym.mod = mapMods_Keys(ev.key.keysym.mod & ~KMOD_CAPS); 1393 ev.key.keysym.mod = mapMods_Keys(ev.key.keysym.mod & ~KMOD_CAPS);
1392 } 1394 }
1393#if defined (iPlatformAndroidMobile) 1395#if defined (iPlatformAndroidMobile)
1396 /* Use the system Back button to close panels, if they're open. */
1397 if (ev.type == SDL_KEYDOWN && ev.key.keysym.sym == SDLK_AC_BACK) {
1398 SDL_UserEvent panelBackCmd = { .type = SDL_USEREVENT,
1399 .code = command_UserEventCode,
1400 .data1 = iDupStr("panel.close"),
1401 .data2 = d->window->base.keyRoot };
1402 if (dispatchEvent_Window(&d->window->base, (SDL_Event *) &panelBackCmd)) {
1403 continue; /* Was handled by someone. */
1404 }
1405 }
1394 /* Ignore all mouse events; just use touch. */ 1406 /* Ignore all mouse events; just use touch. */
1395 if (ev.type == SDL_MOUSEBUTTONDOWN || 1407 if (ev.type == SDL_MOUSEBUTTONDOWN ||
1396 ev.type == SDL_MOUSEBUTTONUP || 1408 ev.type == SDL_MOUSEBUTTONUP ||