-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Got BadWindow exception while trying to get active window on Linux #19
Comments
Also got a crash now, log seems kind of different so cause is likely different though.
|
Got the same one as @johan-bjareholt :
RT says I exclusively opened google-chrome/emacs/terminator at that time (as I always do), so it ain't due to a specific window. and relatedly to ActivityWatch/aw-qt#19, and again at
|
Looked more closely at the code and the issue I and @nikanar stumbled upon was quite obvious. Commited straight to master here a8e704f We need to handle the Xlib.error.BadWindow exception properly to fix the original problem which @ErikBjare posted though. |
After running for almost two weeks, I didn't get BadWindow but instead a BadValue exception.
|
Got one
Might be linked to a window that was behaving very badly, a single chrome google-sheets tab which wasn't displayed at all by my awesome wm, it would appear when I fullscreened it, but again disappear entirely when I un-fullscreen it back, I had to toggle |
I'm guessing we could work around this issue by catching XError's and retrying, or simply returning None which would indicate the active window was unknown (probably better since we won't have to worry about very fast retries). I think it's caused by the See xlib source here: https://github.com/python-xlib/python-xlib/blob/master/Xlib/error.py Also, that Wrote this while a bit sleep deprived during a 7h layover at the Vaclav Havel Airport in Prague... Results may vary. |
and now I got the same
Will try and patch things up as @ErikBjare suggested... done. We should get more warnings and less crashes now, which sounds like a good thing to me ! |
This should hopefully be fixed now with @nikanar 's PR. Please reopen if anyone encounters this issue again. |
Set up deployment of release builds with Travis
Got this while running aw-watcher-window (commit 7612c4a):
The text was updated successfully, but these errors were encountered: