We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2996 - Grabbed input does not create SDL_MOUSEMOTION events on X11 (issue introduced post-2.0.3)
Summary: Grabbed input does not create SDL_MOUSEMOTION events on X11 (issue introduced...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.4
Depends on:
Blocks:
 
Reported: 2015-05-28 20:26 UTC by Zack Middleton (zturtleman)
Modified: 2015-06-07 22:30 UTC (History)
1 user (show)

See Also:


Attachments
Make testrelative use SDL_SetWindowGrab (520 bytes, patch)
2015-05-28 20:26 UTC, Zack Middleton (zturtleman)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zack Middleton (zturtleman) 2015-05-28 20:26:50 UTC
Created attachment 2165 [details]
Make testrelative use SDL_SetWindowGrab

SDL_MOUSEMOTION events are not sent for grabbed windows when relative mouse mode is enabled on Linux X11. It was introduced by commit https://hg.libsdl.org/SDL/rev/c9c61d66cfa0

If the owner_events (the third argument for X11_XGrabPointer) is changed back to True then SDL_MOUSEMOTION events are sent as expected.

Attached is a patch that modifies the "testrelative" program to use grabbed input to demonstrate the issue (the red block representing the cursor does not move).

My thought would be to change X11_XGrabPointer to use True in X11_CaptureMouse and X11_SetWindowGrab, though I don't really understand what the argument does[1] and haven't tested CaptureMouse at all.

[1] http://tronche.com/gui/x/xlib/input/XGrabPointer.html
Comment 1 Ryan C. Gordon 2015-05-28 21:26:11 UTC
Gonna look at this for 2.0.4.

--ryan.
Comment 2 Ryan C. Gordon 2015-06-07 22:02:14 UTC
I backed out the problem changeset with https://hg.libsdl.org/SDL/rev/42877ed9b1c5, please verify this solves the problem on your end, please!

--ryan.
Comment 3 Zack Middleton (zturtleman) 2015-06-07 22:09:59 UTC
Yes, that solved the issue.
Comment 4 Ryan C. Gordon 2015-06-07 22:30:54 UTC
(In reply to Zack Middleton from comment #3)
> Yes, that solved the issue.

Thank you!

--ryan.