From 0e51e33b83244095b5830cea5063412e510a671d Mon Sep 17 00:00:00 2001 From: Twig6943 <119701717+Twig6943@users.noreply.github.com> Date: Tue, 4 Nov 2025 23:09:02 +0300 Subject: [PATCH] Allow user to use wayland backend of gdk Users can set GDK_BACKEND by themselves which will override the default x11 value --- src/xenia/ui/windowed_app_main_posix.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xenia/ui/windowed_app_main_posix.cc b/src/xenia/ui/windowed_app_main_posix.cc index 2ff6c51c1..ed3ecd23b 100644 --- a/src/xenia/ui/windowed_app_main_posix.cc +++ b/src/xenia/ui/windowed_app_main_posix.cc @@ -19,7 +19,10 @@ int main(int argc_pre_gtk, char** argv_pre_gtk) { // Before touching anything GTK+, make sure that when running on Wayland, // we'll still get an X11 (Xwayland) window - setenv("GDK_BACKEND", "x11", 1); + // also allow users to override this + if (!secure_getenv("GDK_BACKEND")) { + setenv("GDK_BACKEND", "x11", 1); + } // Initialize GTK+, which will handle and remove its own arguments from argv. // Both GTK+ and Xenia use --option=value argument format (see man