diff src/video/directfb/SDL_DirectFB_mouse.c @ 2940:b93965a16fe0

Fixed X11 mouse motion/button events - it's not actually safe to cast mouse events to device events. Fixed building SDL without XInput support Simplified the process of registering a mouse device
author Sam Lantinga <slouken@libsdl.org>
date Thu, 01 Jan 2009 07:59:08 +0000
parents 6ce28e5287e9
children d364ee9b9c15
line wrap: on
line diff
--- a/src/video/directfb/SDL_DirectFB_mouse.c	Thu Jan 01 07:58:20 2009 +0000
+++ b/src/video/directfb/SDL_DirectFB_mouse.c	Thu Jan 01 07:59:08 2009 +0000
@@ -47,6 +47,7 @@
         SDL_Mouse mouse;
 
         SDL_zero(mouse);
+        mouse.id = device_id;
         mouse.CreateCursor = DirectFB_CreateCursor;
         mouse.ShowCursor = DirectFB_ShowCursor;
         mouse.MoveCursor = DirectFB_MoveCursor;
@@ -55,10 +56,8 @@
         mouse.FreeMouse = DirectFB_FreeMouse;
         mouse.cursor_shown = 1;
 
-        SDL_SetMouseIndexId(device_id, devdata->num_mice);
-        SDL_AddMouse(&mouse, devdata->num_mice, desc.name, 0, 0, 1);
-        devdata->mouse_id[devdata->num_mice] = device_id;
-        devdata->num_mice++;
+        SDL_AddMouse(&mouse, desc.name, 0, 0, 1);
+        devdata->mouse_id[devdata->num_mice++] = device_id;
     }
     return DFENUM_OK;
 }
@@ -91,9 +90,7 @@
         mouse.FreeMouse = DirectFB_FreeMouse;
         mouse.cursor_shown = 1;
 
-        SDL_SetMouseIndexId(0, 0);      /* ID == Index ! */
-        devdata->mouse_id[0] = 0;
-        SDL_AddMouse(&mouse, 0, "Mouse", 0, 0, 1);
+        SDL_AddMouse(&mouse, "Mouse", 0, 0, 1);
         devdata->num_mice = 1;
     }
 }