From ee8801b54d526cf79188b4aed40d97e5f783822b Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 28 Nov 2024 19:34:40 -0500 Subject: [PATCH] WM (Linux): fix wl-restart parsing (#1422) Make the WM name in `wl-restart -n 5 Hyprland` parse as "Hyprland" instead of "-n". --- src/detection/displayserver/linux/wayland/wayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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