From 53e1492367d8638f3c30a762f839ebed9dbbf27a Mon Sep 17 00:00:00 2001 From: Riteo Date: Tue, 10 Sep 2024 23:03:47 +0200 Subject: [PATCH] Wayland: Add environment variable to disable libdecor loading Libdecor has some quirks and depending on the setup it might be useful to switch to the xdg-shell branch. Recompiling the whole engine without libdecor is not an acceptable way to do that. --- platform/linuxbsd/wayland/wayland_thread.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/linuxbsd/wayland/wayland_thread.cpp b/platform/linuxbsd/wayland/wayland_thread.cpp index 66be313ff6c0..3f63cddcc7a6 100644 --- a/platform/linuxbsd/wayland/wayland_thread.cpp +++ b/platform/linuxbsd/wayland/wayland_thread.cpp @@ -3739,10 +3739,16 @@ Error WaylandThread::init() { } #endif // SOWRAP_ENABLED - if (libdecor_found) { - libdecor_context = libdecor_new(wl_display, (struct libdecor_interface *)&libdecor_interface); + bool skip_libdecor = OS::get_singleton()->has_environment("GODOT_WAYLAND_DISABLE_LIBDECOR"); + + if (skip_libdecor) { + print_verbose("Skipping libdecor check because GODOT_WAYLAND_DISABLE_LIBDECOR is set."); } else { - print_verbose("libdecor not found. Client-side decorations disabled."); + if (libdecor_found) { + libdecor_context = libdecor_new(wl_display, (struct libdecor_interface *)&libdecor_interface); + } else { + print_verbose("libdecor not found. Client-side decorations disabled."); + } } #endif // LIBDECOR_ENABLED