Mercurial > sdl-ios-xcode
diff src/video/x11/SDL_x11video.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 | 99210400e8b9 |
children | ee331407574f |
line wrap: on
line diff
--- a/src/video/x11/SDL_x11video.c Thu Jan 01 07:58:20 2009 +0000 +++ b/src/video/x11/SDL_x11video.c Thu Jan 01 07:59:08 2009 +0000 @@ -28,14 +28,6 @@ #include "SDL_x11video.h" -#if SDL_VIDEO_DRIVER_X11_XINPUT -XDevice **SDL_XDevices; -int SDL_NumOfXDevices; -XEventClass SDL_XEvents[256]; -int SDL_NumOfXEvents; -int motion, button_pressed, button_released; /* the definitions of the mice events */ -int proximity_in, proximity_out; -#endif /* Initialization/Query functions */ static int X11_VideoInit(_THIS); @@ -218,8 +210,6 @@ int X11_VideoInit(_THIS) { - int i, index = 0, event_code; - XEventClass xEvent; SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; /* Get the window class name, usually the name of the application */ @@ -253,49 +243,6 @@ } X11_InitMouse(_this); - /* Set reasonable defaults, in case !SDL_VIDEO_DRIVER_X11_XINPUT */ - motion = MotionNotify; - button_pressed = ButtonPress; - button_released = ButtonRelease; - -#if SDL_VIDEO_DRIVER_X11_XINPUT - /* we're generating the table of events that should be recognized */ - for (i = 0; i < SDL_NumOfXDevices; ++i) { - /* button events */ - DeviceButtonPress(SDL_XDevices[i], event_code, xEvent); - if (xEvent) { - SDL_XEvents[index++] = xEvent; - button_pressed = event_code; - } - DeviceButtonRelease(SDL_XDevices[i], event_code, xEvent); - if (xEvent) { - SDL_XEvents[index++] = xEvent; - button_released = event_code; - } - - /* proximity events */ - ProximityIn(SDL_XDevices[i], event_code, xEvent); - if (xEvent) { - SDL_XEvents[index++] = xEvent; - proximity_in = event_code; - } - ProximityOut(SDL_XDevices[i], event_code, xEvent); - if (xEvent) { - SDL_XEvents[index++] = xEvent; - proximity_out = event_code; - } - - /* motion events */ - DeviceMotionNotify(SDL_XDevices[i], event_code, xEvent); - if (xEvent) { - SDL_XEvents[index++] = xEvent; - motion = event_code; - } - - } - SDL_NumOfXEvents = index; -#endif - return 0; } @@ -318,10 +265,6 @@ X11_QuitModes(_this); X11_QuitKeyboard(_this); X11_QuitMouse(_this); - -#if SDL_VIDEO_DRIVER_X11_XINPUT - free(SDL_XDevices); -#endif } /* vim: set ts=4 sw=4 expandtab: */