diff --git a/pyprland/command.py b/pyprland/command.py index 5faf1f3..a9563ba 100644 --- a/pyprland/command.py +++ b/pyprland/command.py @@ -38,14 +38,15 @@ def remove_duplicate(names: list[str]) -> Callable: def _remove_duplicates(fn: Callable) -> Callable: """Wrapper for the decorator.""" - async def _wrapper(self: Self, full_name: str, *params: str, notify: str = "") -> bool: + async def _wrapper(self: Self, full_name: str, *args, **kwargs) -> bool: """Wrapper for the function.""" if full_name in names: - key = (full_name, params) + key = (full_name, args) + print(key) if key == _dedup_last_call.get(full_name): return True _dedup_last_call[full_name] = key - return await fn(self, full_name, *params, notify) + return await fn(self, full_name, *args, **kwargs) return _wrapper @@ -213,7 +214,7 @@ async def _run_plugin_handler(self, plugin: Plugin, full_name: str, params: tupl self.log.exception("%s::%s(%s) failed:", plugin.name, full_name, params) await notify_error(f"Pypr error {plugin.name}::{full_name}: {e}") - @remove_duplicate(names=["active_window"]) + @remove_duplicate(names=["active_window", "active_windowv2"]) async def _call_handler(self, full_name: str, *params: str, notify: str = "") -> bool: """Call an event handler with params.""" handled = False diff --git a/pyprland/version.py b/pyprland/version.py index 08ee081..eb33ca3 100644 --- a/pyprland/version.py +++ b/pyprland/version.py @@ -1,3 +1,3 @@ """Package version.""" -VERSION = "2.4.0-6" +VERSION = "2.4.0-7"