Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11: Check for button presses before clearing an XInput2 pointer grab
XInput2 will grab the pointer on button presses, which causes the grab attempt to fail and ultimately timeout since the pointer is already grabbed, however, ungrabbing the pointer when no buttons are pressed and the pointer is outside the window can generate enter/leave notify events, which result in further calls of the grab function. The end result is an infinite loop of grab/ungrab attempts generating enter/leave events. This causes a hang in testautomation when creating a window with the grabbed flag if the pointer is not positioned within window bounds. Check the button state and only ungrab if a mouse button is in the pressed state.
- Loading branch information