From d96d41395e9a5971cb30af8485250f38dcb414ff Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 16 Feb 2026 19:25:20 +0100 Subject: [PATCH] Fix startup errors/warnings on X11 when the Prefer Wayland editor setting is enabled This makes the editor setting act as if it's ignored when not currently on a Wayland session. (cherry picked from commit 8462c586bf65ef8e4629d859ff9b332ee5946253) --- main/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/main.cpp b/main/main.cpp index 65d21d45ec..1c8d5a4c8f 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -3043,7 +3043,12 @@ Error Main::setup2(bool p_show_boot_logo) { init_custom_scale = value; init_custom_scale_found = true; } else if (!prefer_wayland_found && assign == "run/platforms/linuxbsd/prefer_wayland") { - prefer_wayland = value; + if (!OS::get_singleton()->get_environment("WAYLAND_DISPLAY").is_empty()) { + // Do not prefer Wayland if not currently on a Wayland session. + // This avoids error messages on startup when currently on X11 + // and the Prefer Wayland setting is enabled. + prefer_wayland = value; + } prefer_wayland_found = true; } else if (!tablet_found && assign == "interface/editor/tablet_driver") { tablet_driver_editor = value;