refactor(src/window): use hyprctl dispatch to focus windows
Improve resilience of window focus by delegating to hyprctl.
This commit is contained in:
1 file changed
+2
-2
+2
-2
@@ -791,8 +791,8 @@ class AppBar(Box):
|
|||||||
if event.button == 1: # Left click - focus window
|
if event.button == 1: # Left click - focus window
|
||||||
if instance_address:
|
if instance_address:
|
||||||
try:
|
try:
|
||||||
self._hyprland_connection.send_command(
|
GLib.spawn_command_line_async(
|
||||||
f"dispatch focuswindow address:{instance_address}"
|
f"hyprctl dispatch 'hl.dsp.focus({{ window = \"address:{instance_address}\" }})'"
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"[AppBar] Error focusing window: {e}")
|
logger.error(f"[AppBar] Error focusing window: {e}")
|
||||||
|
|||||||
Reference in new issue
Block a user