Skip to content

Commit e26ef5e

Browse files
committed
Add a --launch option to appcontroller
This will trigger a "fire and forget" mode where we won't bother with the server sockets. This allows launching multiple apps with appcontroller without killing the previous one. This is the preferred approach to launch Wayland applications. We still would like to use appcontroller (to set up the environment) but killing the previous app is not desirable. Tooling does not need to be considered now. Change-Id: I9119d622b12aaf79cfb2e68c95bacd079dffeb52 Reviewed-by: Rainer Keller <[email protected]>
1 parent fe76b7a commit e26ef5e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ int main(int argc, char **argv)
223223
quint16 gdbDebugPort = 0;
224224
bool useGDB = false;
225225
bool useQML = false;
226+
bool fireAndForget = false;
226227
Utils::PortList range;
227228

228229
if (args.isEmpty()) {
@@ -254,6 +255,8 @@ int main(int argc, char **argv)
254255
} else if (arg == "--stop") {
255256
stop();
256257
return 0;
258+
} else if (arg == "--launch") {
259+
fireAndForget = true;
257260
} else if (arg == "--show-platform") {
258261
printf("base:%s\nplatform:%s\n",
259262
config.base.toLocal8Bit().constData(),
@@ -323,7 +326,7 @@ int main(int argc, char **argv)
323326
defaultArgs.push_front("gdbserver");
324327
}
325328

326-
if (createServerSocket() != 0) {
329+
if (!fireAndForget && createServerSocket() != 0) {
327330
fprintf(stderr, "Could not create serversocket\n");
328331
return 1;
329332
}
@@ -338,7 +341,8 @@ int main(int argc, char **argv)
338341
process.setSocketNotifier(new QSocketNotifier(serverSocket, QSocketNotifier::Read, &process));
339342
process.start(defaultArgs);
340343
app.exec();
341-
close(serverSocket);
344+
if (!fireAndForget)
345+
close(serverSocket);
342346
return 0;
343347
}
344348

0 commit comments

Comments
 (0)