1
0
Fork 0
forked from fte/fteqw

fix bug reported by ciscon: do not crash when XDG_SESSION_TYPE is unset in linux's environment.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5348 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2018-12-02 09:01:51 +00:00
parent 8f664f2b2e
commit 2a3c667f09

View file

@ -727,12 +727,15 @@ static int WL_GetPriority(void)
//2 = above x11, 0 = below x11.
char *stype = getenv("XDG_SESSION_TYPE");
char *dpyname;
if (!strcmp(stype, "wayland"))
return 2;
if (!strcmp(stype, "x11"))
return 0;
if (!strcmp(stype, "tty")) //FIXME: support this!
return 0;
if (stype)
{
if (!strcmp(stype, "wayland"))
return 2;
if (!strcmp(stype, "x11"))
return 0;
if (!strcmp(stype, "tty")) //FIXME: support this!
return 0;
}
//otherwise if both WAYLAND_DISPLAY and DISPLAY are defined, then we assume that we were started from xwayland wrapper thing, and that the native/preferred windowing system is wayland.
//(lets just hope our wayland support is comparable)