From 96c239c4b2996f8efd161403fc8c223f97a288e8 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Fri, 3 Aug 2018 10:17:51 +1200 Subject: [PATCH] Force GDK_BACKEND=x11 to avoid segv under wayland Reported by Philip Balister. --- src/aven.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/aven.cc b/src/aven.cc index 5a34f644..4a828bb5 100644 --- a/src/aven.cc +++ b/src/aven.cc @@ -177,6 +177,13 @@ bool Aven::Initialize(int& my_argc, wxChar **my_argv) #else int main(int argc, char **argv) { +#ifdef __WXGTK3__ + // Currently wxGLCanvas doesn't work under Wayland, and the code segfaults. + // https://trac.wxwidgets.org/ticket/17702 + // Setting GDK_BACKEND=x11 is the recommended workaround, and it seems to + // work to set it here. + setenv("GDK_BACKEND", "x11", 1); +#endif #ifdef __WXMAC__ // MacOS passes a magic -psn_XXXX command line argument in argv[1] which // wx ignores for us, but in wxApp::Initialize() which hasn't been -- 2.11.4.GIT