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 - Fixes to some relative mouse mode bugs.
Summary: Fixes to some relative mouse mode bugs.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Mac OS X 10.7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-07 16:13 UTC by Wim
Modified: 2012-02-20 21:03 UTC (History)
1 user (show)

See Also:


Attachments
The patches (4.20 KB, application/octet-stream)
2012-02-07 16:13 UTC, Wim
Details

Note You need to log in before you can comment on or make changes to this bug.
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!