From 4db8bf072bc610d7f4cd7cfe38d5fa59a7a8b41e Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Sun, 19 May 2024 13:14:42 +0200 Subject: [PATCH] Linux: Force SDL2 video driver selection to X11 --- src/main/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/main.cpp b/src/main/main.cpp index 826533e..6cc83ad 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -51,6 +51,11 @@ ultramodern::gfx_callbacks_t::gfx_data_t create_gfx() { SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE, "1"); SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); + +#if defined(__linux__) && defined(SDL_VIDEO_DRIVER_WAYLAND) + SDL_SetHint(SDL_HINT_VIDEODRIVER, "x11"); +#endif + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) > 0) { exit_error("Failed to initialize SDL2: %s\n", SDL_GetError()); }