From 31c9f026c5c4eb1adee6055a605d2f3c687f1199 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Wed, 12 Jan 2022 15:10:20 +0100 Subject: [PATCH] [UI] Force use of Xwayland when running on Wayland --- src/xenia/ui/windowed_app_main_posix.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xenia/ui/windowed_app_main_posix.cc b/src/xenia/ui/windowed_app_main_posix.cc index 60b93a04e..dc99e243d 100644 --- a/src/xenia/ui/windowed_app_main_posix.cc +++ b/src/xenia/ui/windowed_app_main_posix.cc @@ -18,6 +18,10 @@ #include "xenia/ui/windowed_app_context_gtk.h" extern "C" 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); + // Initialize GTK+, which will handle and remove its own arguments from argv. // Both GTK+ and Xenia use --option=value argument format (see man // gtk-options), however, it's meaningless to try to parse the same argument