From d79fab24b1d5c92869afb72a9a8bc7a251d32824 Mon Sep 17 00:00:00 2001 From: kStor2poche <43518872+kStor2poche@users.noreply.github.com> Date: Tue, 6 May 2025 22:37:41 +0200 Subject: [PATCH] QOL: automatically enable native wayland if supported display is found --- src/main/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/main.cpp b/src/main/main.cpp index fbc5196..b2d2026 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -67,6 +67,10 @@ ultramodern::gfx_callbacks_t::gfx_data_t create_gfx() { SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); + if (getenv("WAYLAND_DISPLAY") != NULL) { + SDL_SetHint(SDL_HINT_VIDEODRIVER, "wayland"); + } + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) > 0) { exit_error("Failed to initialize SDL2: %s\n", SDL_GetError()); }