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 1165 - SDL_GetMouseState() returns wrong location after switch to/from fullscreen
Summary: SDL_GetMouseState() returns wrong location after switch to/from fullscreen
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86 Mac OS X 10.6
: P2 minor
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-09 16:09 UTC by Vern Jensen
Modified: 2011-03-11 18:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vern Jensen 2011-03-09 16:09:44 UTC
If you switch from windowed mode to fullscreen, or back, the cursor's location within the window will be different. Yet, SDL_GetMouseState() continues to return the old (incorrect) mouse location from prior to the switch. This continues until the user moves the mouse, at which point it instantly correctly itself to the correct location, and works properly from them on out.

Version: SDL-1.3.0-5445

Most other mouse stuff seems to be working -- great work!!
Comment 1 Sam Lantinga 2011-03-11 18:25:27 UTC
I'm solving this by moving the mouse to the correct location after a fullscreen mode switch:
http://hg.libsdl.org/SDL/rev/5c4635640bf9

Thanks!