Skip to content

Commit

Permalink
fix: fixed things I broke when refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Feb 1, 2021
1 parent 94bc969 commit 9af9993
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion aw_watcher_window/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
4 changes: 2 additions & 2 deletions aw_watcher_window/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down Expand Up @@ -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()


Expand Down

0 comments on commit 9af9993

Please sign in to comment.