From 76194980cb4b7d9436a4f8aefa8e83d45b4b2ef1 Mon Sep 17 00:00:00 2001 From: The_miro Date: Sun, 5 Jul 2026 19:22:37 +0200 Subject: [PATCH] fix(astal-menu): focus windows via hyprlua dispatcher, not native focuswindow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Open-windows taskbar dispatched `hyprctl dispatch focuswindow address:…`, but this is a hyprlua setup where `hyprctl dispatch` evaluates its argument as Lua — so the native dispatcher syntax raised a Lua parse error and nothing happened. Switch to `hl.dsp.focus({ window = "address:…" })`, the hyprlua focus dispatcher, which focuses the window and switches to its workspace. Verified it moves across workspaces end-to-end. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01XUWCXM4KhjRkwheaA3X7bP --- desktopenvs/hyprlua/astal-menu/ui/taskbar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktopenvs/hyprlua/astal-menu/ui/taskbar.py b/desktopenvs/hyprlua/astal-menu/ui/taskbar.py index 84b00df..9836df7 100644 --- a/desktopenvs/hyprlua/astal-menu/ui/taskbar.py +++ b/desktopenvs/hyprlua/astal-menu/ui/taskbar.py @@ -109,6 +109,11 @@ class Taskbar(Gtk.Box): def _focus(self, w) -> None: addr = w.get("address") if addr: - run_text(["hyprctl", "dispatch", "focuswindow", f"address:{addr}"], + # This is a hyprlua (Lua-configured Hyprland) setup: `hyprctl dispatch` + # evaluates its argument as Lua, so the native `focuswindow address:…` + # syntax is a Lua error. Use the hyprlua focus dispatcher, which also + # switches to the window's workspace. + run_text(["hyprctl", "dispatch", + f'hl.dsp.focus({{ window = "address:{addr}" }})'], lambda *_a: None) self._on_activate()