1 From 394f48a1e535f464879fa94196ee6d73b86894f5 Mon Sep 17 00:00:00 2001
2 From: Scott Murray <scott.murray@konsulko.com>
3 Date: Thu, 4 Aug 2022 14:36:08 -0400
4 Subject: [PATCH] Add xdg-shell-app-id command-line argument
6 Add a command-line argument for specifying the app id, so that basic
7 applications do not need to supply a full JSON configuration just to
10 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
12 shell/main.cc | 10 ++++++++++
13 1 file changed, 10 insertions(+)
15 diff --git a/shell/main.cc b/shell/main.cc
16 index deb4876..ba35acc 100644
19 @@ -161,6 +161,16 @@ int main(int argc, char** argv) {
20 FML_DLOG(INFO) << "Window Type: " << config.view.window_type;
21 RemoveArgument(config.view.vm_args, "--window-type=" + config.view.window_type);
23 + if (cl.HasOption("xdg-shell-app-id")) {
24 + cl.GetOptionValue("xdg-shell-app-id", &config.app_id);
25 + if (config.app_id.empty()) {
27 + << "--xdg-shell-app-id option requires an argument (e.g. --xdg-shell-app-id=gallery)";
28 + return EXIT_FAILURE;
30 + FML_DLOG(INFO) << "Application ID: " << config.app_id;
31 + RemoveArgument(config.view.vm_args, "--xdg-shell-app-id=" + config.app_id);
35 auto vm_arg_count = config.view.vm_args.size();