Skip to content

Commit b3305b8

Browse files
stendlergithub-actions[bot]
authored andcommitted
fix: enable to run natively in wayland
Incorporated from this v2 change: wailsapp#1811
1 parent d7677f1 commit b3305b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

v3/pkg/application/application_linux.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ import (
2727
func init() {
2828
// FIXME: This should be handled appropriately in the individual files most likely.
2929
// Set GDK_BACKEND=x11 if currently unset and XDG_SESSION_TYPE is unset, unspecified or x11 to prevent warnings
30-
_ = os.Setenv("GDK_BACKEND", "x11")
30+
if os.Getenv("GDK_BACKEND") == "" && (os.Getenv("XDG_SESSION_TYPE") == "" || os.Getenv("XDG_SESSION_TYPE") == "unspecified" || os.Getenv("XDG_SESSION_TYPE") == "x11") {
31+
_ = os.Setenv("GDK_BACKEND", "x11")
32+
}
3133
}
3234

3335
type linuxApp struct {

0 commit comments

Comments
 (0)