diff --git a/src/detection/displayserver/linux/wayland/wayland.c b/src/detection/displayserver/linux/wayland/wayland.c index e4b387a51..d09eb06f9 100644 --- a/src/detection/displayserver/linux/wayland/wayland.c +++ b/src/detection/displayserver/linux/wayland/wayland.c @@ -39,7 +39,7 @@ static bool waylandDetectWM(int fd, FFDisplayServerResult* result) filename = result->wmProcessName.chars; if (ffStrEquals(filename, "wl-restart")) - ffStrbufSubstrAfterFirstC(&result->wmProcessName, '\0'); + ffStrbufSubstrAfterLastC(&result->wmProcessName, '\0'); ffStrbufSubstrBeforeFirstC(&result->wmProcessName, '\0'); //Trim the arguments ffStrbufSubstrAfterLastC(&result->wmProcessName, '/'); //Trim the path