src/video/x11/SDL_x11xinput2.c
changeset 6877 7287d385e6b3
parent 6433 8bbb5ff8788f
child 6885 700f1b25f77f
     1.1 --- a/src/video/x11/SDL_x11xinput2.c	Thu Feb 14 13:22:05 2013 -0800
     1.2 +++ b/src/video/x11/SDL_x11xinput2.c	Thu Feb 14 15:40:19 2013 -0800
     1.3 @@ -62,7 +62,8 @@
     1.4  #endif /* SDL_VIDEO_DRIVER_X11_XINPUT2 */
     1.5  
     1.6  void 
     1.7 -X11_InitXinput2(_THIS) {
     1.8 +X11_InitXinput2(_THIS)
     1.9 +{
    1.10  #if SDL_VIDEO_DRIVER_X11_XINPUT2
    1.11      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    1.12  
    1.13 @@ -83,7 +84,8 @@
    1.14      *
    1.15      * FIXME:event and err are not needed but if not passed XQueryExtension returns SegmentationFault
    1.16      */
    1.17 -    if (!XQueryExtension(data->display, "XInputExtension", &xinput2_opcode, &event, &err)) {
    1.18 +    if (!SDL_X11_HAVE_XINPUT2 ||
    1.19 +        !XQueryExtension(data->display, "XInputExtension", &xinput2_opcode, &event, &err)) {
    1.20          return;
    1.21      }
    1.22  
    1.23 @@ -122,7 +124,8 @@
    1.24  
    1.25  
    1.26  int 
    1.27 -X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie) {
    1.28 +X11_HandleXinput2Event(SDL_VideoData *videodata,XGenericEventCookie *cookie)
    1.29 +{
    1.30  #if SDL_VIDEO_DRIVER_X11_XINPUT2
    1.31      if(cookie->extension != xinput2_opcode) {
    1.32          return 0;
    1.33 @@ -175,7 +178,8 @@
    1.34  }
    1.35  
    1.36  void 
    1.37 -X11_InitXinput2Multitouch(_THIS) {
    1.38 +X11_InitXinput2Multitouch(_THIS)
    1.39 +{
    1.40  #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
    1.41      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    1.42      XIDeviceInfo *info;
    1.43 @@ -218,7 +222,8 @@
    1.44  }
    1.45  
    1.46  void 
    1.47 -X11_Xinput2SelectTouch(_THIS, SDL_Window *window) {
    1.48 +X11_Xinput2SelectTouch(_THIS, SDL_Window *window)
    1.49 +{
    1.50  #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
    1.51      if (!X11_Xinput2IsMultitouchSupported()) {
    1.52          return;
    1.53 @@ -243,7 +248,8 @@
    1.54  
    1.55  
    1.56  int 
    1.57 -X11_Xinput2IsInitialized() {
    1.58 +X11_Xinput2IsInitialized()
    1.59 +{
    1.60  #if SDL_VIDEO_DRIVER_X11_XINPUT2
    1.61      return xinput2_initialized;
    1.62  #else
    1.63 @@ -252,7 +258,8 @@
    1.64  }
    1.65  
    1.66  int
    1.67 -X11_Xinput2IsMultitouchSupported() {
    1.68 +X11_Xinput2IsMultitouchSupported()
    1.69 +{
    1.70  #if SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH
    1.71      return xinput2_initialized && xinput2_multitouch_supported;
    1.72  #else