mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[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.
This commit is contained in:
parent
f7d4efe1c1
commit
012ac950ac
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user