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 4407

Summary: Mouse position changes while in relative mouse mode SDL_SetRelativeMouseMode
Product: SDL Reporter: ihcusk
Component: eventsAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.9   
Hardware: x86   
OS: Windows 7   

Description ihcusk 2018-12-01 16:40:22 UTC
From https://wiki.libsdl.org/SDL_SetRelativeMouseMode :
"Only relative motion events will be delivered, the mouse position will not change."

After disabling the relative mouse mode and moving the mouse, the cursor is in a different position than where it was before enabling the mode.

Example C program: https://pastebin.com/a2JNrMT8

Windows 7 32-bit, MinGW-w64 GCC 7.3.0, SDL 2.0.9
Comment 1 ihcusk 2018-12-01 16:55:59 UTC
(In reply to ihcusk from comment #0)
> From https://wiki.libsdl.org/SDL_SetRelativeMouseMode :
> "Only relative motion events will be delivered, the mouse position will not
> change."
> 
> After disabling the relative mouse mode and moving the mouse, the cursor is
> in a different position than where it was before enabling the mode.
> 
> Example C program: https://pastebin.com/a2JNrMT8
> 
> Windows 7 32-bit, MinGW-w64 GCC 7.3.0, SDL 2.0.9

Sorry, I meant:
After disabling the relative mouse mode, the cursor is in a different position than where it was before enabling the mode and moving the mouse.
Comment 2 ihcusk 2018-12-01 17:22:22 UTC
(In reply to ihcusk from comment #0)
> From https://wiki.libsdl.org/SDL_SetRelativeMouseMode :
> "Only relative motion events will be delivered, the mouse position will not
> change."
> 
> After disabling the relative mouse mode and moving the mouse, the cursor is
> in a different position than where it was before enabling the mode.
> 
> Example C program: https://pastebin.com/a2JNrMT8
> 
> Windows 7 32-bit, MinGW-w64 GCC 7.3.0, SDL 2.0.9

There is an error in the example program. Again, sorry.
Correct version: https://pastebin.com/hLQnkkRP