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 1060

Summary: When using touchscreen input, SDL_MOUSEMOTION events give erratic values if input grab is on AND showcursor is off.
Product: SDL Reporter: InterAction studios <support>
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED DUPLICATE QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: jspradlin
Version: 1.2.14   
Hardware: x86   
OS: Other   

Description InterAction studios 2010-09-29 07:40:03 UTC
Hardware: Lenovo S10-3t
OS: Meego 1.0 for netbooks (build 1.0.90.2.20100914.1)
Kernel: 2.6.35.3-6.3-netbook

Reproduction steps:

1. Open the "testwm" test suite from the SDL package.
2. Uncomment the #if under SDL_MOUSEMOTION to debug mouse events.
3. Compile and run.
4. Press Ctrl-G to grab input
5. Drag finger on touchscreen a short horizontal distance right-to-left across SDL window
6. Look at the debug output. The mouse relative motion numbers are erratic, and do not correspond to real-world movement.

For example, this is the output:
...
Mouse motion: {639,86} (268,-84)
Mouse motion: {639,3} (267,-83)
Mouse motion: {639,0} (265,-81)
Mouse motion: {639,0} (264,-80)
Mouse motion: {639,0} (262,-78)
...

The correct output would be:
...
Mouse motion: {371,260} (-1,0)
Mouse motion: {370,260} (-1,0)
Mouse motion: {369,259} (-1,-1)
Mouse motion: {368,259} (-1,0)
Mouse motion: {367,259} (-1,0)
Mouse motion: {366,259} (-1,0)
...


This problem only appears when ALL of the following are true:

1. Touchscreen input
2. SDL_WM_GrabInput(SDL_GRAB_ON);
3. SDL_ShowCursor(0);
Comment 1 Jen Spradlin 2011-04-12 20:12:27 UTC
Thank you for your bug report!

We're busy working on getting SDL 1.3 ready for a high quality release, and want to make sure as many things are fixed there as possible.
Could you check to see if your bug is resolved by the latest SDL 1.3 snapshot?
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!
Comment 2 InterAction studios 2011-04-29 11:21:09 UTC
Yes, I'm getting correct behaviour when using SDL-1.3.0-5538

(In reply to comment #1)
Comment 3 Sam Lantinga 2012-01-02 00:11:25 UTC

*** This bug has been marked as a duplicate of bug 1040 ***