bar: fix workspaces switching

Fix throwing errors when trying to switch to current ws
This commit is contained in:
2 * r + 2 * t 2025-05-02 13:48:30 +10:00
parent 8e8ea841de
commit 7ee7dc59a6

View file

@ -70,7 +70,11 @@ Item {
MouseArea {
anchors.fill: parent
onPressed: event => Hyprland.dispatch(`workspace ${layout.childAt(event.x, event.y).index + root.groupOffset + 1}`)
onPressed: event => {
const ws = layout.childAt(event.x, event.y).index + root.groupOffset + 1;
if (Hyprland.activeWsId !== ws)
Hyprland.dispatch(`workspace ${ws}`);
}
onWheel: event => {
const activeWs = Hyprland.activeClient?.workspace?.name;
if (activeWs?.startsWith("special:"))