diff --git a/src/detection/displayserver/linux/wayland/wayland.c b/src/detection/displayserver/linux/wayland/wayland.c index 2b64bbce3..71671a74d 100644 --- a/src/detection/displayserver/linux/wayland/wayland.c +++ b/src/detection/displayserver/linux/wayland/wayland.c @@ -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