# HG changeset patch # User Sam Lantinga # Date 1219736063 0 # Node ID 76c2fc9696ea35960ae7d805faafb757da39dc8f # Parent f23ebf1ddac4b2f684b4f3adda85a667d2ac8cc3 Fixed crash when tablet isn't detected properly diff -r f23ebf1ddac4 -r 76c2fc9696ea src/events/SDL_mouse.c --- a/src/events/SDL_mouse.c Tue Aug 26 06:03:48 2008 +0000 +++ b/src/events/SDL_mouse.c Tue Aug 26 07:34:23 2008 +0000 @@ -374,6 +374,11 @@ int index = SDL_GetMouseIndexId(id); SDL_Mouse *mouse = SDL_GetMouse(index); int posted = 0; + + if (!mouse) { + return 0; + } + last_x = x; last_y = y; if (SDL_ProcessEvents[type] == SDL_ENABLE) { diff -r f23ebf1ddac4 -r 76c2fc9696ea src/events/SDL_mouse_c.h --- a/src/events/SDL_mouse_c.h Tue Aug 26 06:03:48 2008 +0000 +++ b/src/events/SDL_mouse_c.h Tue Aug 26 07:34:23 2008 +0000 @@ -112,15 +112,18 @@ /* Set the mouse focus window */ extern void SDL_SetMouseFocus(int id, SDL_WindowID windowID); -/* Send a mouse motion event for a mouse at an index */ +/* Send a mouse motion event for a mouse */ extern int SDL_SendMouseMotion(int id, int relative, int x, int y, int z); -/* Send a mouse button event for a mouse at an index */ +/* Send a mouse button event for a mouse */ extern int SDL_SendMouseButton(int id, Uint8 state, Uint8 button); -/* Send a mouse wheel event for a mouse at an index */ +/* Send a mouse wheel event for a mouse */ extern int SDL_SendMouseWheel(int id, int x, int y); +/* Send a proximity event for a mouse */ +extern int SDL_SendProximity(int id, int x, int y, int type); + /* Shutdown the mouse subsystem */ extern void SDL_MouseQuit(void);