From 2def6346e6e8eaf5d6d2f5f1ead6bddf4833be5d Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 19 Jun 2019 09:01:28 +1000 Subject: [PATCH] [client] don't override SDL_VIDEODRIVER if it is already set --- VERSION | 2 +- client/src/main.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index c46d1a4e..bdf84a32 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-rc5-10-g75de895b62+1 \ No newline at end of file +B1-rc6-0-g607539a2af+1 \ No newline at end of file diff --git a/client/src/main.c b/client/src/main.c index 96a8fd64..711e9011 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1014,13 +1014,16 @@ int run() if (strcmp(XDG_SESSION_TYPE, "wayland") == 0) { DEBUG_INFO("Wayland detected"); - int err = setenv("SDL_VIDEODRIVER", "wayland", 1); - if (err < 0) + if (getenv("SDL_VIDEO_DRIVER") == NULL) { - DEBUG_ERROR("Unable to set the env variable SDL_VIDEODRIVER: %d", err); - return -1; + int err = setenv("SDL_VIDEODRIVER", "wayland", 1); + if (err < 0) + { + DEBUG_ERROR("Unable to set the env variable SDL_VIDEODRIVER: %d", err); + return -1; + } + DEBUG_INFO("SDL_VIDEODRIVER has been set to wayland"); } - DEBUG_INFO("SDL_VIDEODRIVER has been set to wayland"); } // warn about using FPS display until we can fix the font rendering to prevent lag spikes