WM (Linux): don't use wl-restart as WM name

Fix #1135
This commit is contained in:
Carter Li
2024-07-31 14:19:42 +08:00
parent bd5012edc8
commit 7eaaed6024
@@ -30,8 +30,19 @@ static bool waylandDetectWM(int fd, FFDisplayServerResult* result)
if (!ffReadFileBuffer(procPath.chars, &result->wmProcessName))
return false;
// #1135: wl-restart is a special case
const char* filename = strrchr(result->wmProcessName.chars, '/');
if (filename)
filename++;
else
filename = result->wmProcessName.chars;
if (ffStrEquals(filename, "wl-restart"))
ffStrbufSubstrAfterFirstC(&result->wmProcessName, '\0');
ffStrbufSubstrBeforeFirstC(&result->wmProcessName, '\0'); //Trim the arguments
ffStrbufSubstrAfterLastC(&result->wmProcessName, '/'); //Trim the path
return true;
}
#else