From 9af99932aee107c4d44779f2d2284136d0269217 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Mon, 1 Feb 2021 14:44:20 +0100 Subject: [PATCH] fix: fixed things I broke when refactoring --- aw_watcher_window/lib.py | 3 ++- aw_watcher_window/macos.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/aw_watcher_window/lib.py b/aw_watcher_window/lib.py index 9660249..56463a4 100644 --- a/aw_watcher_window/lib.py +++ b/aw_watcher_window/lib.py @@ -19,7 +19,8 @@ def get_current_window_linux() -> Dict[str, str]: def get_current_window_macos() -> Dict[str, str]: from . import macos # TODO: This should return the latest event, or block until there is one - return macos.get_window_event() + # TODO: This currently discards the event timestamp, but it should propagate upwards... + return macos.get_window_event()[1] def get_current_window_windows() -> Dict[str, str]: diff --git a/aw_watcher_window/macos.py b/aw_watcher_window/macos.py index 94f3153..c60a3e1 100644 --- a/aw_watcher_window/macos.py +++ b/aw_watcher_window/macos.py @@ -31,7 +31,7 @@ def init(callback: Callable) -> None: hand_over_main(watcher, callback) # will take control of the main thread and spawn a second one for pushing heartbeats -def get_current_window() -> Dict[str, str]: +def get_window_event() -> Tuple[float, Dict[str, str]]: return watcher.get_next_event() @@ -78,7 +78,7 @@ def run_loop(self): def stop(self): AppHelper.stopEventLoop() - def get_next_event(self) -> Dict[str, str]: + def get_next_event(self) -> Tuple[float, Dict[str, str]]: return self.observer.queue.get()