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:
parent
8f664f2b2e
commit
2a3c667f09
1 changed files with 875 additions and 872 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue