From 71bedc63613cdc301b29c6e96458c2b4b5c7ef45 Mon Sep 17 00:00:00 2001 From: Patrick Pacher Date: Tue, 19 Jul 2022 15:31:35 +0200 Subject: [PATCH] Automatically append arguments required by Electron to run on wayland --- cmds/portmaster-start/run.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmds/portmaster-start/run.go b/cmds/portmaster-start/run.go index 8881b2d6..046549d0 100644 --- a/cmds/portmaster-start/run.go +++ b/cmds/portmaster-start/run.go @@ -121,6 +121,20 @@ func getExecArgs(opts *Options, cmdArgs []string) []string { if stdinSignals { 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", + }..., + ) + + } + args = append(args, cmdArgs...) return args }