From 88a84ae9f215f70379c3b5f5f04143246ef6c0ae Mon Sep 17 00:00:00 2001 From: stendler Date: Sat, 13 Jul 2024 18:06:50 +0200 Subject: [PATCH] fix: enable to run natively in wayland Incorporated from this v2 change: https://github.com/wailsapp/wails/pull/1811 --- v3/pkg/application/application_linux.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v3/pkg/application/application_linux.go b/v3/pkg/application/application_linux.go index 6ec75588647..ed136204ea5 100644 --- a/v3/pkg/application/application_linux.go +++ b/v3/pkg/application/application_linux.go @@ -27,7 +27,9 @@ import ( func init() { // FIXME: This should be handled appropriately in the individual files most likely. // Set GDK_BACKEND=x11 if currently unset and XDG_SESSION_TYPE is unset, unspecified or x11 to prevent warnings - _ = os.Setenv("GDK_BACKEND", "x11") + if os.Getenv("GDK_BACKEND") == "" && (os.Getenv("XDG_SESSION_TYPE") == "" || os.Getenv("XDG_SESSION_TYPE") == "unspecified" || os.Getenv("XDG_SESSION_TYPE") == "x11") { + _ = os.Setenv("GDK_BACKEND", "x11") + } } type linuxApp struct {