Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix the cursor not always grabbed again correctly after a focus gain #1107
Small fix for #614
This PR includes a commit that fixes cursor not being grabbed again (happening quite often) after a focus gain on Linux (with X11). The fix consists in repeating the grab process up to 5 times (defined in a constant in the private namespace of the file). Between each attempt, a small sleep is inserted (50 ms).
Still some questions : maybe 5 attempts is a bit too much, but it should not happen very often (The mouse is effectively grabbed on the first or second attempt almost everytime on my computer).
(It's also almost like SDL is doing it, except that they use an infinite loop !)