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 1414

Summary: Fixes to some relative mouse mode bugs.
Product: SDL Reporter: Wim <ghostunderscore>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: ghostunderscore
Version: HG 2.0   
Hardware: x86   
OS: Mac OS X 10.7   
Attachments: The patches

Description Wim 2012-02-07 16:13:28 UTC
Created attachment 816 [details]
The patches

Some patches to fix some problems I found using relative mouse mode.

The first is simply fixing a crash when disabling relative mouse mode without the mouse being over an SDL window, since the cursor was not being controlled by SDL we don't need to bother warping it around.

The second moves some of the low level cursor control from the window manager to the mouse manager.  I'm not entirely certain this is correct, but I believe when the cursor is outside an SDL window it should be rendered with the default look, while saving what look it had for when the window is re-entered.

The reason behind this change was the cursor was not being hidden/unhidden when relative mode was enabled/disabled with the mouse outside any SDL window.

The third change saves the current x, y co-ordinates when relative mode is entered and then restores them when relative mode is disabled.  I'm pretty sure this was the intended behavior of the warp.



I've generated the patches using `hg export`, if there's some better way to generate them just let me know.
Comment 1 Sam Lantinga 2012-02-20 21:03:52 UTC
These look good, and I've imported them into the main SDL repository.
Thanks!