fix(astal-menu): focus windows via hyprlua dispatcher, not native focuswindow

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XUWCXM4KhjRkwheaA3X7bP
feat/astal-menu
Amir Alexander Abdelbaki 2026-07-05 19:22:37 +02:00
parent b9e80fbfbe
commit 76194980cb
1 changed files with 6 additions and 1 deletions

View File

@ -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()