mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 01:58:25 +00:00
Default XDG_SESSION_TYPE to unspecified
Minimal systems in cases may not have XDG_SESSION_TYPE set at all, causing the program to segfault at the `strcmp`. This commit sets XDG_SESSION_TYPE to `unspecified` (according to https://www.freedesktop.org/software/systemd/man/pam_systemd.html) if it is not defined in the environment.
This commit is contained in:
parent
0674e04597
commit
f75e2fe8db
@ -733,6 +733,11 @@ int run()
|
|||||||
state.fpsSleep = 1000000 / params.fpsLimit;
|
state.fpsSleep = 1000000 / params.fpsLimit;
|
||||||
|
|
||||||
char* XDG_SESSION_TYPE = getenv("XDG_SESSION_TYPE");
|
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 (strcmp(XDG_SESSION_TYPE, "wayland") == 0) {
|
||||||
DEBUG_INFO("Wayland detected");
|
DEBUG_INFO("Wayland detected");
|
||||||
int err = setenv("SDL_VIDEODRIVER", "wayland", 1);
|
int err = setenv("SDL_VIDEODRIVER", "wayland", 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user