summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 }