QOL: automatically enable native wayland if supported display is found

This commit is contained in:
kStor2poche 2025-05-06 22:37:41 +02:00
parent 54997438de
commit d79fab24b1

View file

@ -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());
}