From 9fdc54bfffbcb72241a0cbaa5960ed7d15f36c0b Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Mon, 27 Apr 2020 13:02:16 +0200 Subject: [PATCH] Fix app crash on startup under Linux/GTK3/Wayland config --- src/PrusaSlicer.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PrusaSlicer.cpp b/src/PrusaSlicer.cpp index 751df6fbf..9efecb50c 100644 --- a/src/PrusaSlicer.cpp +++ b/src/PrusaSlicer.cpp @@ -57,6 +57,14 @@ using namespace Slic3r; int CLI::run(int argc, char **argv) { + +#ifdef __WXGTK__ + // On Linux, wxGTK has no support for Wayland, and the app crashes on + // startup if gtk3 is used. This env var has to be set explicitly to + // instruct the window manager to fall back to X server mode. + ::setenv("GDK_BACKEND", "x11", /* replace */ true); +#endif + // Switch boost::filesystem to utf8. try { boost::nowide::nowide_filesystem();