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 2728

Summary: SDL_MOUSEMOTION outside of window - inconsistency
Product: SDL Reporter: Mervin <muckmeck>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: amit.jain83, muckmeck, oss, p.sangra
Version: 2.0.3   
Hardware: x86   
OS: Windows (XP)   
Attachments: patch to fix issue

Description Mervin 2014-09-15 07:37:02 UTC
Press the left mouse button with the pointer inside the window and keep the button pressed. Move the pointer outside of the window and release the button. Now the next mouse movement outside of the window triggers a single SDL_MOUSEMOTION event, which reports absolute x,y coordinates clamped to the window dimensions but not xrel,yrel.
This event doesn't seem to be triggered directly above the window, only left right and below the window.

This SDL_MOUSEMOTION event beyond the window shouldn't appear.
Comment 1 Amit Jain 2015-08-03 10:37:34 UTC
Hi
Any update or fix for this defect ?
Comment 2 Pankaj 2015-08-11 09:32:11 UTC
Hi Mervin,

Is this defect reproduced 100% in your case?
In my case, this is being reproduced only when mouse pointer dragged fast outside the window and release the button.
Comment 3 Emily Dobervich 2015-08-30 21:20:06 UTC
Created attachment 2257 [details]
patch to fix issue

Attached a patch for this issue.

The call to SDL_UpdateMouseFocus on SDL_RELEASED originally struck me as
unnecessary, but after further digging I suspect it has something to do with
something with SUPPORT_DRAG_OUTSIDE_WINDOW. If anyone knows for sure, I'd be
interested in hearing about it.