| Summary: | Duplicate Xi2 raw motion events when relative mouse input is enabled | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Victor Luchits <vluchits> |
| Component: | events | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | adem4ik, icculus |
| Version: | 2.0.3 | Keywords: | target-2.0.4 |
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: | Proposed patch | ||
|
Description
Victor Luchits
2015-04-26 15:00:31 UTC
Proposed solution can be found here: http://lists.libsdl.org/pipermail/sdl-libsdl.org/2015-April/000288.html tried it by my self http://lists.libsdl.org/pipermail/sdl-libsdl.org/2015-April/000288.html changing True to False in X11_SetWindowGrab's X11_XGrabPointer will fix the duplicated events, but it will break mouse buttons. though applying the second part of his solution by using tip "X11_GrabPointer inside X11_SetWIndowGrab should act the same as in X11_CaptureMouse" actually makes the proper fix for the duplicated events w/o breaking mouse buttons. Created attachment 2154 [details] Proposed patch As per http://lists.libsdl.org/pipermail/sdl-libsdl.org/2015-April/000288.html Verified to work. Fixed, thanks! https://hg.libsdl.org/SDL/rev/c9c61d66cfa0 This patch caused Bug #2996, so I've backed it out with https://hg.libsdl.org/SDL/rev/42877ed9b1c5 --ryan. I don't know, I've read the passage in the XGrabPointer() documentation about owner_events about a million times now, and while I don't _really_ know what it means, I think the initial reading of it was definitely wrong. This definitely seems like an bug in the X server to me, but I confess that I don't really understand the problem fully. I think we need to punt on this for 2.0.4 at this point (I thought we were simply processing core and Xinput motion events, but it turns out the server is literally sending us duplicates, which we probably can't work around). --ryan. In case this is either an x.org bug or I just can't figure out how this is meant to work, I hedged my bets with https://hg.libsdl.org/SDL/rev/957a6ed39ad0 ... now we don't change those XGrabInput() calls, but we also ignore duplicate motion events, which should hopefully make everyone happy for 2.0.4, and then we'll figure out something more proper after that. --ryan. In Warsow we only called XIGrabDevice on slave devices. This approach didn't cause duplication of raw events but I'm not really sure it was the right kind of black magic one has to use when dealing with X11. https://github.com/Warsow/qfusion/blob/master/source/unix/unix_input.c#L224 |