From 53fd66e23c28f8088399dc9ef5c8ce5dee20df17 Mon Sep 17 00:00:00 2001 From: grbr404 <166065505+grbr404@users.noreply.github.com> Date: Thu, 29 May 2025 19:20:17 +0200 Subject: made the wayland/x11 check better --- source/application/StarMainApplication_sdl.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source/application/StarMainApplication_sdl.cpp') diff --git a/source/application/StarMainApplication_sdl.cpp b/source/application/StarMainApplication_sdl.cpp index a53a433..c124d72 100644 --- a/source/application/StarMainApplication_sdl.cpp +++ b/source/application/StarMainApplication_sdl.cpp @@ -259,13 +259,14 @@ public: } #ifdef STAR_SYSTEM_LINUX // Checks for Wayland and uses it if available, otherwise uses X11. - if (SDL_getenv("WAYLAND_DISPLAY") != nullptr) { - SDL_setenv("SDL_VIDEODRIVER", "wayland", 1); - Logger::info("Application: Using Wayland window system"); - } else { - SDL_setenv("SDL_VIDEODRIVER", "x11", 1); - Logger::info("Application: Using X11 window system"); - } + if (SDL_getenv("SDL_VIDEODRIVER") == nullptr) { + if (SDL_getenv("WAYLAND_DISPLAY") != nullptr) { + SDL_setenv("SDL_VIDEODRIVER", "wayland", 1); + } else { + SDL_setenv("SDL_VIDEODRIVER", "x11", 1); + } + } + Logger::info("Application: using Windowing System '{}'", SDL_GetCurrentVideoDriver()); #endif Logger::info("Application: Initializing SDL Video"); -- cgit v1.2.3