From f4030d579bb19c4fa3efeee96423b2556abfc188 Mon Sep 17 00:00:00 2001 From: Patrick Pacher Date: Tue, 19 Jul 2022 15:58:08 +0200 Subject: [PATCH] Fix linter error and make identifier check more explicit --- cmds/portmaster-start/run.go | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/cmds/portmaster-start/run.go b/cmds/portmaster-start/run.go index 046549d0..97dd38f7 100644 --- a/cmds/portmaster-start/run.go +++ b/cmds/portmaster-start/run.go @@ -122,17 +122,18 @@ func getExecArgs(opts *Options, cmdArgs []string) []string { args = append(args, "--input-signals") } - // see https://www.freedesktop.org/software/systemd/man/pam_systemd.html#type= - if xdgSessionType := os.Getenv("XDG_SESSION_TYPE"); xdgSessionType == "wayland" && opts.Identifier == "app/portmaster-app.zip" { - // we're running the Portmaster UI App under Wayland so make sure we add some arguments - // required by Electron - args = append(args, - []string{ - "--enable-features=UseOzonePlatform", - "--ozone-platform=wayland", - }..., - ) - + if opts.Identifier == "app/portmaster-app.zip" { + // see https://www.freedesktop.org/software/systemd/man/pam_systemd.html#type= + if xdgSessionType := os.Getenv("XDG_SESSION_TYPE"); xdgSessionType == "wayland" { + // we're running the Portmaster UI App under Wayland so make sure we add some arguments + // required by Electron + args = append(args, + []string{ + "--enable-features=UseOzonePlatform", + "--ozone-platform=wayland", + }..., + ) + } } args = append(args, cmdArgs...)