From 4235674d939327012cc9a4a770ed19548f606dc9 Mon Sep 17 00:00:00 2001 From: fdev31 Date: Sat, 29 Apr 2023 23:45:16 +0200 Subject: [PATCH] scratchpad: Skip focus tracking when auto-hiding Since it's due to a focus change... --- pyprland/plugins/scratchpads.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyprland/plugins/scratchpads.py b/pyprland/plugins/scratchpads.py index 3d63391..d705946 100644 --- a/pyprland/plugins/scratchpads.py +++ b/pyprland/plugins/scratchpads.py @@ -182,7 +182,7 @@ class Extension(Plugin): and scratch.conf.get("unfocus") == "hide" and scratch.uid not in self.transitioning_scratches ): - await self.run_hide(uid) + await self.run_hide(uid, autohide=True) async def event_openwindow(self, params) -> None: addr, wrkspc, kls, title = params.split(",", 3) @@ -228,7 +228,7 @@ class Extension(Plugin): if add_to_address_book: self.scratches_by_address[scratch.clientInfo["address"][2:]] = scratch - async def run_hide(self, uid: str, force=False) -> None: + async def run_hide(self, uid: str, force=False, autohide=False) -> None: """ hides scratchpad "name" """ uid = uid.strip() item = self.scratches.get(uid) @@ -268,9 +268,10 @@ class Extension(Plugin): if ( animation_type and uid in self.focused_window_tracking ): # focus got lost when animating - await hyprctl( - f"focuswindow address:{self.focused_window_tracking[uid]['address']}" - ) + if not autohide: + await hyprctl( + f"focuswindow address:{self.focused_window_tracking[uid]['address']}" + ) async def run_show(self, uid, force=False) -> None: """ shows scratchpad "name" """