lol

prusa-slicer: allow wayland (#417751)

authored by

Arne Keller and committed by
GitHub
fd5efe59 ba7f45db

+61
+54
pkgs/applications/misc/prusa-slicer/allow_wayland.patch
··· 1 + commit c9282b73f3d09daff23a2603addd94605596ebe7 2 + Author: Robert Schiele <rschiele@gmail.com> 3 + Date: Thu May 8 19:16:46 2025 +0200 4 + 5 + remove forcing GDK_BACKEND to x11 6 + 7 + It seems the problems on Wayland from the past are removed meanwhile. 8 + 9 + diff --git a/src/CLI/GuiParams.cpp b/src/CLI/GuiParams.cpp 10 + index f44b91651f..41b42ff368 100644 11 + --- a/src/CLI/GuiParams.cpp 12 + +++ b/src/CLI/GuiParams.cpp 13 + @@ -107,9 +107,8 @@ int start_gui_with_params(GUI::GUI_InitParams& params) 14 + #if !defined(_WIN32) && !defined(__APPLE__) 15 + // likely some linux / unix system 16 + const char* display = boost::nowide::getenv("DISPLAY"); 17 + - // const char *wayland_display = boost::nowide::getenv("WAYLAND_DISPLAY"); 18 + - //if (! ((display && *display) || (wayland_display && *wayland_display))) { 19 + - if (!(display && *display)) { 20 + + const char *wayland_display = boost::nowide::getenv("WAYLAND_DISPLAY"); 21 + + if (! ((display && *display) || (wayland_display && *wayland_display))) { 22 + // DISPLAY not set. 23 + boost::nowide::cerr << "DISPLAY not set, GUI mode not available." << std::endl << std::endl; 24 + print_help(false); 25 + @@ -141,4 +140,4 @@ int start_as_gcode_viewer(GUI::GUI_InitParams& gui_params) 26 + } 27 + #else // SLIC3R_GUI 28 + // If there is no GUI, we shall ignore the parameters. Remove them from the list. 29 + -#endif // SLIC3R_GUI 30 + \ No newline at end of file 31 + +#endif // SLIC3R_GUI 32 + diff --git a/src/CLI/Setup.cpp b/src/CLI/Setup.cpp 33 + index 82e03d466d..95acdf3477 100644 34 + --- a/src/CLI/Setup.cpp 35 + +++ b/src/CLI/Setup.cpp 36 + @@ -212,11 +212,6 @@ static bool setup_common() 37 + save_main_thread_id(); 38 + 39 + #ifdef __WXGTK__ 40 + - // On Linux, wxGTK has no support for Wayland, and the app crashes on 41 + - // startup if gtk3 is used. This env var has to be set explicitly to 42 + - // instruct the window manager to fall back to X server mode. 43 + - ::setenv("GDK_BACKEND", "x11", /* replace */ true); 44 + - 45 + // https://github.com/prusa3d/PrusaSlicer/issues/12969 46 + ::setenv("WEBKIT_DISABLE_COMPOSITING_MODE", "1", /* replace */ false); 47 + ::setenv("WEBKIT_DISABLE_DMABUF_RENDERER", "1", /* replace */ false); 48 + @@ -338,4 +333,4 @@ bool setup(Data& cli, int argc, char** argv) 49 + return true; 50 + } 51 + 52 + -} 53 + \ No newline at end of file 54 + +}
+7
pkgs/applications/misc/prusa-slicer/default.nix
··· 70 70 rev = "version_${finalAttrs.version}"; 71 71 }; 72 72 73 + # only applies to prusa slicer because super-slicer overrides *all* patches 74 + patches = [ 75 + # https://github.com/NixOS/nixpkgs/issues/415703 76 + # https://gitlab.archlinux.org/archlinux/packaging/packages/prusa-slicer/-/merge_requests/5 77 + ./allow_wayland.patch 78 + ]; 79 + 73 80 # (not applicable to super-slicer fork) 74 81 postPatch = lib.optionalString (finalAttrs.pname == "prusa-slicer") ( 75 82 # Patch required for GCC 14, but breaks on clang