Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed crash when tablet isn't detected properly
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 26, 2008
1 parent 93c32a5 commit 83e2586
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/events/SDL_mouse.c
Expand Up @@ -374,6 +374,11 @@ SDL_SendProximity(int id, int x, int y, int type)
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) {
Expand Down
9 changes: 6 additions & 3 deletions src/events/SDL_mouse_c.h
Expand Up @@ -112,15 +112,18 @@ extern void SDL_ResetMouse(int index);
/* 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);

Expand Down

0 comments on commit 83e2586

Please sign in to comment.