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 104 - SDL_WarpMouse does not change MouseState
Summary: SDL_WarpMouse does not change MouseState
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: don't know
Hardware: x86 Linux
: P2 blocker
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-29 00:31 UTC by Sam Lantinga
Modified: 2006-05-09 03:20 UTC (History)
0 users

See Also:


Attachments
main.c (889 bytes, text/plain)
2006-01-29 00:32 UTC, Sam Lantinga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Lantinga 2006-01-29 00:31:55 UTC
Date: Thu, 30 Sep 2004 19:23:12 +0200
From: Ivo Danihelka <i.danihelka@sh.cvut.cz>
Subject: [SDL] bug: SDL_WarpMouse does not change MouseState

First call of SDL_WarpMouse() wraps mouse cursor but does not change
mouse position returned by SDL_GetMouseState(). This happends when mouse
starts outside window. The position remains [0, 0].                 

The second call of SDL_WarpMouse() updates mouse position to right
values.

I attached test program which wraps mouse and 10 times prints mouse
position. Start with mouse out of window and don't move it. Positions
will be [0, 0] instead of [320, 240].

System Information:                  
SDL 1.2.7
XFree86 Version 4.3.99.12
Comment 1 Sam Lantinga 2006-01-29 00:32:14 UTC
Created attachment 48 [details]
main.c
Comment 2 Sam Lantinga 2006-01-29 00:33:10 UTC
Date: Fri, 1 Oct 2004 12:49:05 +0200
From: Johannes Schmidt <sdl@myrealbox.com>
Subject: Re: [SDL] bug: SDL_WarpMouse does not change MouseState

If your mouse cursor is not within the SDL frame and you warp the mouse, you
get an enter notify, not a motion notify.
Therefore, SDL does not update its internal mouse state.

What's about calling SDL_PrivateMouseMotion even when getting an EnterNotify?

Regards,
Johannes
Comment 3 Sam Lantinga 2006-05-07 17:15:11 UTC
I'd like to get this fixed for SDL 1.2.10 release, if possible.
Comment 4 Sam Lantinga 2006-05-09 03:20:38 UTC
This is fixed in Subversion.