Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/application
diff options
context:
space:
mode:
authorgrbr404 <166065505+grbr404@users.noreply.github.com>2025-05-29 19:20:17 +0200
committerGitHub <noreply@github.com>2025-05-29 19:20:17 +0200
commit53fd66e23c28f8088399dc9ef5c8ce5dee20df17 (patch)
tree216f7b7930c71752ed48e6d7d1ccd0a539624653 /source/application
parent0ae1e2ababc2581ffc1fa6e64d7ec021f1063c06 (diff)
made the wayland/x11 check better
Diffstat (limited to 'source/application')
-rw-r--r--source/application/StarMainApplication_sdl.cpp15
1 files changed, 8 insertions, 7 deletions
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");