Closed phil294 closed 2 years ago
Also tests seem to randomly fail as soon as you have 83 or more tests (??). At least in my setup, on normal Display X11 (Xfwm), when I repeated some of the standard tests, I got weird X display closed errors
I think this approach is horrible and suggest this experiment should not be merged and closed instead. I wanted to share it anyway.
Thanks for sharing it! Yeah, I agree -- overriding the default error handler isn't guaranteed to be MT-safe, so we shouldn't attempt it in this library.
For the time being, I'd like to keep these bindings limited to just the API surface exposed by libxdo
. If you can convince the upstream to merge an API for getting a window by its ID, I'd be more than happy to expose that API here 🙂
ok makes sense
closes #13
It looks like there is none.
Yes - I tried doing that in this PR. However, you cannot simply do
because when
id
is invalid, xdotool does not catch the X11 error and that kills the entire process... so I think the only way is to temporarily override the default X11 error handler like I did. Unless I missed something?I think this approach is horrible and suggest this experiment should not be merged and closed instead. I wanted to share it anyway.
Another downside is that binding to
XSetErrorHandler
can conflict with other libraries that do similar stuff. It most likely fails to build in conjunction with https://github.com/TamasSzekeres/x11-cr but I haven't tested.