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 1071

Summary: Mouse enter/leave events broken on Mac
Product: SDL Reporter: Vern Jensen <vern>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: Other   
OS: Mac OS X 10.6   

Description Vern Jensen 2010-10-25 10:59:06 UTC
The SDL_WINDOWEVENT_ENTER and SDL_WINDOWEVENT_LEAVE are each called *every single time the mouse is moved* on MacOS X 10.6. With the event handler below, I get a stream of printf() statements in the console log for moving the mouse, regardless of whether the cursor enters/leaves the window or not.

void MyHandleSDLEvent(SDL_Event * event, int *done) 
{ 
switch (event->type) 
{ 

case SDL_WINDOWEVENT: 
switch (event->window.event) 
{ 
case SDL_WINDOWEVENT_CLOSE: 
*done = 1; 
break; 

case SDL_WINDOWEVENT_ENTER: 
printf("Mouse entered our window! windowID = %d \n", event->window.windowID); 
break; 

case SDL_WINDOWEVENT_LEAVE: 
printf("Mouuse left the window! windowID = %d \n", event->window.windowID); 
break; 

} 
break;
Comment 1 Sam Lantinga 2011-01-24 16:16:54 UTC
I believe this is fixed in the latest snapshot, can you retest?
http://www.libsdl.org/tmp/SDL-1.3.zip

Thanks!
Comment 2 Vern Jensen 2011-01-24 16:49:26 UTC
Yup, works perfectly now. Thanks!
Comment 3 Sam Lantinga 2011-01-24 17:49:18 UTC
Great! :)