Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Make sure to send MOUSEMOTION on window enter.

This should hopefully fix bug #1612. We now send mousemotion events when
the cursor enters the window as well as when it leaves.

Thanks to Alex Szpakowski for the fix.

Fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1612
  • Loading branch information
jorgenpt committed Apr 24, 2013
1 parent 6c5f798 commit 8e89a32f5a656f0df21c549707a6bbfc31b201da

File 1 of 2 in 8e89a32

@@ -165,13 +165,11 @@ SDL_UpdateMouseFocus(SDL_Window * window, int x, int y, Uint32 buttonstate)
}

if (window != mouse->focus) {
mouse->last_x = x;
mouse->last_y = y;

#ifdef DEBUG_MOUSE
printf("Mouse entered window, synthesizing focus gain event\n");
printf("Mouse entered window, synthesizing focus gain & move event\n");
#endif
SDL_SetMouseFocus(window);
SDL_SetMouseFocus(window);
SDL_PrivateSendMouseMotion(window, mouse->mouseID, 0, x, y);
}
return SDL_TRUE;
}
@@ -686,4 +684,4 @@ SDL_ShowCursor(int toggle)
return shown;
}

/* vi: set ts=4 sw=4 expandtab: */
/* vi: set ts=4 sw=4 expandtab: */

0 comments on commit 8e89a32

Please sign in to comment.