From d7d3ce9e44dd96a40b3ec3740b777f0bd35a103e Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 21 May 2021 12:09:36 +0300 Subject: Behavior of opening URLs via command line Open all URLs/files specified on the command line in new tabs, and raise the window if the app is already running. IssueID #235 --- src/app.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index 591b2cef..e0fe66df 100644 --- a/src/app.c +++ b/src/app.c @@ -576,6 +576,7 @@ static void communicateWithRunningInstance_App_(iApp *d, iProcessId instance, } if (!isEmpty_StringList(openCmds)) { append_String(cmds, collect_String(joinCStr_StringList(openCmds, "\n"))); + requestRaise = iTrue; } if (isEmpty_String(cmds)) { /* By default open a new tab. */ @@ -647,7 +648,6 @@ static void init_App_(iApp *d, int argc, char **argv) { terminate_App_(0); } /* Check for URLs. */ - iBool newTab = iFalse; iConstForEach(CommandLine, i, &d->args) { const iRangecc arg = i.entry; if (i.argType == value_CommandLineArgType) { @@ -662,9 +662,8 @@ static void init_App_(iApp *d, int argc, char **argv) { : makeFileUrl_String(collectNewRange_String(arg)); pushBack_StringList(openCmds, collectNewFormat_String( - "open newtab:%d url:%s", newTab, cstr_String(decUrl))); + "open newtab:1 url:%s", cstr_String(decUrl))); delete_String(decUrl); - newTab = iTrue; } else { fprintf(stderr, "Invalid URL/file: %s\n", cstr_Rangecc(arg)); -- cgit v1.2.3