From 374d49148da745a03b5c36226aaaa19acae45f16 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 25 Jun 2026 13:26:07 +0545 Subject: [PATCH] refactor(src/window): use hyprctl dispatch to focus windows Improve resilience of window focus by delegating to hyprctl. --- src/window/dock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window/dock.py b/src/window/dock.py index 442832d..6c28072 100644 --- a/src/window/dock.py +++ b/src/window/dock.py @@ -791,8 +791,8 @@ class AppBar(Box): if event.button == 1: # Left click - focus window if instance_address: try: - self._hyprland_connection.send_command( - f"dispatch focuswindow address:{instance_address}" + GLib.spawn_command_line_async( + f"hyprctl dispatch 'hl.dsp.focus({{ window = \"address:{instance_address}\" }})'" ) except Exception as e: logger.error(f"[AppBar] Error focusing window: {e}")