From 9a5008c4c3538b5d25a10181d03055b760c0e35b Mon Sep 17 00:00:00 2001 From: Vittorio Parrella Date: Tue, 3 Sep 2024 22:31:13 +0200 Subject: [PATCH] #1 - fix crash when running under wayland --- dlgs_linux.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlgs_linux.go b/dlgs_linux.go index 49c0023..366dd2c 100644 --- a/dlgs_linux.go +++ b/dlgs_linux.go @@ -14,9 +14,15 @@ package dialog import "C" import "unsafe" +import ( + "os" +) + var initSuccess bool func init() { + os.Setenv("GDK_BACKEND", "x11") // fix crash on wayland + C.XInitThreads() initSuccess = (C.gtk_init_check(nil, nil) == C.TRUE) }