You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add a test for search race condition
When window disappear while search is trying to access it (either check
its properties, or enumerate its children), X server will
generate BadWindow error. Try to trigger this race, by opening 100
short living windows and execute xdotool search at the same time. The
search should not crash, and since the window subject to search is there
all the time, it should be found.
The test relies on a specific siming, specifically that launching 100
instance of xterm takes more than 100ms, and that going from setup to
the actual test takes less than 100ms. Those conditions are rather
reasonable, and the test works reliably for me (at this stage - it fails
- the fix is comming in the next commit).
Related to #60
* Fix race condition in search command
When a window is destroyed while search command tries to inspect it (get
its title, class or so), the X server generates BadWindow error. The
default error handler terminates the program. This means the search can
fail if any window is destroyed in the meantime, regardless if the
window matches the search criteria or not.
Fix this by setting an alternative error handler for the search time,
that ignores BadWindow error. This makes the relevant libX11 functions
return (with a negative status) in case of BadWindow error, instead of
interrupting the whole xdotool process.
While at it, fix uninitialized 'children' variable in XQueryTree error
handling.
Fix#60
0 commit comments