From 7ee7dc59a6f2a99b5afae22f730164a9e15ed104 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Fri, 2 May 2025 13:48:30 +1000 Subject: bar: fix workspaces switching Fix throwing errors when trying to switch to current ws --- modules/bar/components/workspaces/Workspaces.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/bar/components/workspaces/Workspaces.qml b/modules/bar/components/workspaces/Workspaces.qml index 1920ffc..0d9817a 100644 --- a/modules/bar/components/workspaces/Workspaces.qml +++ b/modules/bar/components/workspaces/Workspaces.qml @@ -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:")) -- cgit v1.2.3-freya