summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-01-04 13:17:17 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-01-04 13:17:17 +0200
commitac0e8b024707ac16b1960bc167961170e956cb0f (patch)
tree549c73120432d18deddcd729b52071995f6f4c38 /src/app.c
parent458a3d9f42f36b723824eef843190b810512a3cd (diff)
App: Drag-and-drop events passed to all widgets
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/app.c b/src/app.c
index 82232afa..01f62bba 100644
--- a/src/app.c
+++ b/src/app.c
@@ -535,19 +535,22 @@ void processEvents_App(enum iAppEventMode eventMode) {
535 d->isRunning = iFalse; 535 d->isRunning = iFalse;
536 goto backToMainLoop; 536 goto backToMainLoop;
537 case SDL_DROPFILE: { 537 case SDL_DROPFILE: {
538 iBool newTab = iFalse; 538 iBool wasUsed = processEvent_Window(d->window, &ev);
539 if (elapsedSeconds_Time(&d->lastDropTime) < 0.1) { 539 if (!wasUsed) {
540 /* Each additional drop gets a new tab. */ 540 iBool newTab = iFalse;
541 newTab = iTrue; 541 if (elapsedSeconds_Time(&d->lastDropTime) < 0.1) {
542 } 542 /* Each additional drop gets a new tab. */
543 d->lastDropTime = now_Time(); 543 newTab = iTrue;
544 if (startsWithCase_CStr(ev.drop.file, "gemini:") || 544 }
545 startsWithCase_CStr(ev.drop.file, "file:")) { 545 d->lastDropTime = now_Time();
546 postCommandf_App("~open newtab:%d url:%s", newTab, ev.drop.file); 546 if (startsWithCase_CStr(ev.drop.file, "gemini:") ||
547 } 547 startsWithCase_CStr(ev.drop.file, "file:")) {
548 else { 548 postCommandf_App("~open newtab:%d url:%s", newTab, ev.drop.file);
549 postCommandf_App( 549 }
550 "~open newtab:%d url:%s", newTab, makeFileUrl_CStr(ev.drop.file)); 550 else {
551 postCommandf_App(
552 "~open newtab:%d url:%s", newTab, makeFileUrl_CStr(ev.drop.file));
553 }
551 } 554 }
552 break; 555 break;
553 } 556 }