hyprland: fix refreshing on events

This commit is contained in:
2 * r + 2 * t 2025-07-09 00:24:01 +10:00
parent fc31b43ee6
commit 1ac4ac388c

View file

@ -23,15 +23,23 @@ Singleton {
target: Hyprland target: Hyprland
function onRawEvent(event: HyprlandEvent): void { function onRawEvent(event: HyprlandEvent): void {
if (event.name.endsWith("v2")) const n = event.name;
if (n.endsWith("v2"))
return; return;
if (event.name.includes("mon")) if (["workspace", "moveworkspace", "activespecial", "focusedmon"].includes(n)) {
Hyprland.refreshMonitors();
else if (event.name.includes("workspace"))
Hyprland.refreshWorkspaces(); Hyprland.refreshWorkspaces();
else Hyprland.refreshMonitors();
} else if (["openwindow", "closewindow", "movewindow"].includes(n)) {
Hyprland.refreshToplevels();
Hyprland.refreshWorkspaces();
} else if (n.includes("mon")) {
Hyprland.refreshMonitors();
} else if (n.includes("workspace")) {
Hyprland.refreshWorkspaces();
} else if (n.includes("window") || n.includes("group") || ["pin", "fullscreen", "changefloatingmode", "minimize"].includes(n)) {
Hyprland.refreshToplevels(); Hyprland.refreshToplevels();
} }
} }
} }
}