From 012ac950ace0b50158a0074f397c1377c5477d35 Mon Sep 17 00:00:00 2001 From: Tudor Brindus Date: Sun, 3 Jan 2021 20:57:58 -0500 Subject: [PATCH] [client] fix Wayland detection logic $XDG_SESSION_TYPE is not guaranteed to be "wayland" when running on a Wayland compositor. However, $WAYLAND_DISPLAY must always exist. --- client/src/main.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index 99519843..205a49a5 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1508,12 +1508,7 @@ static int lg_run() if (g_cursor.sens < -9) g_cursor.sens = -9; else if (g_cursor.sens > 9) g_cursor.sens = 9; - char* XDG_SESSION_TYPE = getenv("XDG_SESSION_TYPE"); - - if (XDG_SESSION_TYPE == NULL) - XDG_SESSION_TYPE = "unspecified"; - - if (strcmp(XDG_SESSION_TYPE, "wayland") == 0) + if (getenv("WAYLAND_DISPLAY")) { DEBUG_INFO("Wayland detected"); if (getenv("SDL_VIDEODRIVER") == NULL)