ActivityWatch / activitywatch

The best free and open-source automated time tracker. Cross-platform, extensible, privacy-focused.
https://activitywatch.net/
Mozilla Public License 2.0
12.31k stars 554 forks source link

aw-watcher-window can't get active window title on some apps on MacOs #785

Closed Programmierus closed 2 years ago

Programmierus commented 2 years ago

MacOs Monterrey 12.5.1 ActivityWatch 0.12.0

I spent quite some time today trying to solve problems of my ActivityWatch, mostly succeeded (#784), but not completely. As I am tailing the aw-watcher-window_XXXX.log I permanently see following error messages popping up:

2022-09-07 18:58:12 [ERROR]: Exception thrown while trying to get active window  (aw_watcher_window.main:77)
Traceback (most recent call last):
  File "aw_watcher_window/main.py", line 74, in heartbeat_loop
  File "aw_watcher_window/lib.py", line 55, in get_current_window
  File "aw_watcher_window/lib.py", line 27, in get_current_window_macos
  File "aw_watcher_window/macos_jxa.py", line 64, in getInfo
Exception: jxa error: Error: Error: An error occurred.

It is very important to mention though that this now (after I fixed permission issues with #784) happens not on every window. Further research showed that window watcher can't get Brave window titles on my machine nor it can detect e.g. WhatsApp Desktop (as soon as I switch to them those messages popup). But it tracks most other windows without any issue:

image

As you see on screenshot (I marked red) there is other strange behaviour to see: Brave browser's Title was recorded as app: iTerm2 which can't be correct.

Programmierus commented 2 years ago

Relates to #742 (same error text), but different situation...

ErikBjare commented 2 years ago

I've replicated the issue and this should have been resolved in the just-released v0.12.1, let me know if that fixes the issue for you.

jamieastley commented 2 years ago

Came here looking for solutions to the same issue and have just downloaded 0.12.1 which seems to have fixed the problem for me, thanks very much!

(M1 Pro, MacOS 12.5 Beta)

Programmierus commented 2 years ago

Worked like a charm for me! Thanks :)