ActivityWatch / activitywatch

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

Parsec is not getting tracked by aw-watcher-window #889

Open SchittBull opened 1 year ago

SchittBull commented 1 year ago

Describe the bug

Since v0.12.1, parsec.app is not getting tracked anymore. it worked on v0.12.1 tested on 2 machines

To Reproduce

  1. install parsec.app
  2. have parsec active
  3. observe it not being tracked

Expected behavior

parsec being tracked like any other program

Documentation

an excerpt from the log that continues for ever like this:

2023-05-20 09:12:37 [INFO ]: aw-watcher-window started  (aw_watcher_window.main:62)
2023-05-20 09:12:38 [INFO ]: Connection to aw-server established by aw-watcher-window  (aw_client.client:436)
2023-05-20 09:12:38 [ERROR]: Exception thrown while trying to get active window  (aw_watcher_window.main:124)
Traceback (most recent call last):
  File "aw_watcher_window\main.py", line 106, in heartbeat_loop
  File "aw_watcher_window\lib.py", line 65, in get_current_window
  File "aw_watcher_window\lib.py", line 42, in get_current_window_windows
  File "aw_watcher_window\windows.py", line 26, in get_app_name
  File "aw_watcher_window\windows.py", line 15, in get_app_path
pywintypes.error: (5, 'OpenProcess', 'Access is denied.')
2023-05-20 09:12:39 [ERROR]: Exception thrown while trying to get active window  (aw_watcher_window.main:124)
Traceback (most recent call last):
  File "aw_watcher_window\main.py", line 106, in heartbeat_loop
  File "aw_watcher_window\lib.py", line 65, in get_current_window
  File "aw_watcher_window\lib.py", line 42, in get_current_window_windows
  File "aw_watcher_window\windows.py", line 26, in get_app_name
  File "aw_watcher_window\windows.py", line 15, in get_app_path
pywintypes.error: (5, 'OpenProcess', 'Access is denied.')
github-actions[bot] commented 1 year ago

Hi there! As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct. Thanks a bunch for opening your first issue! 🙏

BelKed commented 1 year ago

Thanks for also adding the log :) It seems it's the same problem as in https://github.com/ActivityWatch/activitywatch/issues/873.


From https://github.com/ActivityWatch/activitywatch/issues/873#issuecomment-1555491837:

By reading the change log, the new version switched from WMI to Win32 API (https://github.com/ActivityWatch/aw-watcher-window/pull/83) to obtain a window in focus; I guess it fixed the issue of high CPU usage of WMI Provider Host. That should be the cause of the behaviour change.

It is expected for a program without elevated rights to be unable to access programs with elevated rights. But this might not be a desired behaviour of ActivityWatch.

luzpaz commented 10 months ago

Is this Windows OS related ?