Add a windowID field to SDL_TouchFingerEvent (bug #4331).
authorAlex Szpakowski <slime73@gmail.com>
Thu, 01 Aug 2019 18:22:12 -0300
changeset 12979bbbb30026158
parent 12978 d2e027c5a389
child 12981 42160260ac58
Add a windowID field to SDL_TouchFingerEvent (bug #4331).

This is unimplemented on some platforms and will cause compile errors when building those platform backends for now.
include/SDL_events.h
src/core/linux/SDL_evdev.c
src/events/SDL_mouse.c
src/events/SDL_touch.c
src/events/SDL_touch_c.h
src/video/android/SDL_androidtouch.c
src/video/cocoa/SDL_cocoawindow.m
src/video/emscripten/SDL_emscriptenevents.c
src/video/uikit/SDL_uikitview.m
src/video/wayland/SDL_waylandevents.c
src/video/wayland/SDL_waylandtouch.c
src/video/windows/SDL_windowsevents.c
src/video/winrt/SDL_winrtpointerinput.cpp
src/video/x11/SDL_x11xinput2.c
     1.1 --- a/include/SDL_events.h	Thu Aug 01 17:41:40 2019 +0300
     1.2 +++ b/include/SDL_events.h	Thu Aug 01 18:22:12 2019 -0300
     1.3 @@ -442,6 +442,7 @@
     1.4      float dx;           /**< Normalized in the range -1...1 */
     1.5      float dy;           /**< Normalized in the range -1...1 */
     1.6      float pressure;     /**< Normalized in the range 0...1 */
     1.7 +    Uint32 windowID;    /**< The window underneath the finger, if any */
     1.8  } SDL_TouchFingerEvent;
     1.9  
    1.10  
     2.1 --- a/src/core/linux/SDL_evdev.c	Thu Aug 01 17:41:40 2019 +0300
     2.2 +++ b/src/core/linux/SDL_evdev.c	Thu Aug 01 18:22:12 2019 -0300
     2.3 @@ -403,16 +403,16 @@
     2.4  
     2.5                              switch(item->touchscreen_data->slots[j].delta) {
     2.6                              case EVDEV_TOUCH_SLOTDELTA_DOWN:
     2.7 -                                SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, SDL_TRUE, norm_x, norm_y, norm_pressure);
     2.8 +                                SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, SDL_TRUE, norm_x, norm_y, norm_pressure);
     2.9                                  item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
    2.10                                  break;
    2.11                              case EVDEV_TOUCH_SLOTDELTA_UP:
    2.12 -                                SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, SDL_FALSE, norm_x, norm_y, norm_pressure);
    2.13 +                                SDL_SendTouch(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, SDL_FALSE, norm_x, norm_y, norm_pressure);
    2.14                                  item->touchscreen_data->slots[j].tracking_id = -1;
    2.15                                  item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
    2.16                                  break;
    2.17                              case EVDEV_TOUCH_SLOTDELTA_MOVE:
    2.18 -                                SDL_SendTouchMotion(item->fd, item->touchscreen_data->slots[j].tracking_id, norm_x, norm_y, norm_pressure);
    2.19 +                                SDL_SendTouchMotion(item->fd, item->touchscreen_data->slots[j].tracking_id, /* FIXME: window */, norm_x, norm_y, norm_pressure);
    2.20                                  item->touchscreen_data->slots[j].delta = EVDEV_TOUCH_SLOTDELTA_NONE;
    2.21                                  break;
    2.22                              default:
     3.1 --- a/src/events/SDL_mouse.c	Thu Aug 01 17:41:40 2019 +0300
     3.2 +++ b/src/events/SDL_mouse.c	Thu Aug 01 18:22:12 2019 -0300
     3.3 @@ -339,7 +339,7 @@
     3.4              if (window) {
     3.5                  float fx = (float)x / (float)window->w;
     3.6                  float fy = (float)y / (float)window->h;
     3.7 -                SDL_SendTouchMotion(SDL_MOUSE_TOUCHID, 0, fx, fy, 1.0f);
     3.8 +                SDL_SendTouchMotion(SDL_MOUSE_TOUCHID, 0, window, fx, fy, 1.0f);
     3.9              }
    3.10          }
    3.11      }
    3.12 @@ -509,7 +509,7 @@
    3.13              if (window) {
    3.14                  float fx = (float)mouse->x / (float)window->w;
    3.15                  float fy = (float)mouse->y / (float)window->h;
    3.16 -                SDL_SendTouch(SDL_MOUSE_TOUCHID, 0, track_mouse_down, fx, fy, 1.0f);
    3.17 +                SDL_SendTouch(SDL_MOUSE_TOUCHID, 0, window, track_mouse_down, fx, fy, 1.0f);
    3.18              }
    3.19          }
    3.20      }
     4.1 --- a/src/events/SDL_touch.c	Thu Aug 01 17:41:40 2019 +0300
     4.2 +++ b/src/events/SDL_touch.c	Thu Aug 01 18:22:12 2019 -0300
     4.3 @@ -239,7 +239,7 @@
     4.4  }
     4.5  
     4.6  int
     4.7 -SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid,
     4.8 +SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window,
     4.9                SDL_bool down, float x, float y, float pressure)
    4.10  {
    4.11      int posted;
    4.12 @@ -259,16 +259,6 @@
    4.13          if (mouse->touch_mouse_events) {
    4.14              /* FIXME: maybe we should only restrict to a few SDL_TouchDeviceType */
    4.15              if (id != SDL_MOUSE_TOUCHID) {
    4.16 -                SDL_Window *window = SDL_GetMouseFocus();
    4.17 -                if (window == NULL) {
    4.18 -                    /* Mouse focus may have been lost by e.g. the window resizing
    4.19 -                     * due to device orientation change while the mouse state is
    4.20 -                     * pressed (because its position is now out of the window).
    4.21 -                     * SendMouse* will update mouse focus again after that, but
    4.22 -                     * if those are never called then SDL might think the
    4.23 -                     * 'mouse' has no focus at all. */
    4.24 -                    window = SDL_GetKeyboardFocus();
    4.25 -                }
    4.26                  if (window) {
    4.27                      if (down) {
    4.28                          if (finger_touching == SDL_FALSE) {
    4.29 @@ -332,6 +322,7 @@
    4.30              event.tfinger.dx = 0;
    4.31              event.tfinger.dy = 0;
    4.32              event.tfinger.pressure = pressure;
    4.33 +            event.tfinger.windowID = window ? SDL_GetWindowID(window) : 0;
    4.34              posted = (SDL_PushEvent(&event) > 0);
    4.35          }
    4.36      } else {
    4.37 @@ -344,7 +335,7 @@
    4.38          if (SDL_GetEventState(SDL_FINGERUP) == SDL_ENABLE) {
    4.39              SDL_Event event;
    4.40              event.tfinger.type = SDL_FINGERUP;
    4.41 -            event.tfinger.touchId =  id;
    4.42 +            event.tfinger.touchId = id;
    4.43              event.tfinger.fingerId = fingerid;
    4.44              /* I don't trust the coordinates passed on fingerUp */
    4.45              event.tfinger.x = finger->x;
    4.46 @@ -352,6 +343,7 @@
    4.47              event.tfinger.dx = 0;
    4.48              event.tfinger.dy = 0;
    4.49              event.tfinger.pressure = pressure;
    4.50 +            event.tfinger.windowID = window ? SDL_GetWindowID(window) : 0;
    4.51              posted = (SDL_PushEvent(&event) > 0);
    4.52          }
    4.53  
    4.54 @@ -361,7 +353,7 @@
    4.55  }
    4.56  
    4.57  int
    4.58 -SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
    4.59 +SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window,
    4.60                      float x, float y, float pressure)
    4.61  {
    4.62      SDL_Touch *touch;
    4.63 @@ -382,7 +374,6 @@
    4.64      {
    4.65          if (mouse->touch_mouse_events) {
    4.66              if (id != SDL_MOUSE_TOUCHID) {
    4.67 -                SDL_Window *window = SDL_GetMouseFocus();
    4.68                  if (window) {
    4.69                      if (finger_touching == SDL_TRUE && track_touchid == id && track_fingerid == fingerid) {
    4.70                          int pos_x = (int)(x * (float)window->w);
    4.71 @@ -408,7 +399,7 @@
    4.72  
    4.73      finger = SDL_GetFinger(touch,fingerid);
    4.74      if (!finger) {
    4.75 -        return SDL_SendTouch(id, fingerid, SDL_TRUE, x, y, pressure);
    4.76 +        return SDL_SendTouch(id, fingerid, window, SDL_TRUE, x, y, pressure);
    4.77      }
    4.78  
    4.79      xrel = x - finger->x;
    4.80 @@ -440,6 +431,7 @@
    4.81          event.tfinger.dx = xrel;
    4.82          event.tfinger.dy = yrel;
    4.83          event.tfinger.pressure = pressure;
    4.84 +        event.tfinger.windowID = window ? SDL_GetWindowID(window) : 0;
    4.85          posted = (SDL_PushEvent(&event) > 0);
    4.86      }
    4.87      return posted;
     5.1 --- a/src/events/SDL_touch_c.h	Thu Aug 01 17:41:40 2019 +0300
     5.2 +++ b/src/events/SDL_touch_c.h	Thu Aug 01 18:22:12 2019 -0300
     5.3 @@ -44,11 +44,11 @@
     5.4  extern SDL_Touch *SDL_GetTouch(SDL_TouchID id);
     5.5  
     5.6  /* Send a touch down/up event for a touch */
     5.7 -extern int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid,
     5.8 +extern int SDL_SendTouch(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window,
     5.9                           SDL_bool down, float x, float y, float pressure);
    5.10  
    5.11  /* Send a touch motion event for a touch */
    5.12 -extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid,
    5.13 +extern int SDL_SendTouchMotion(SDL_TouchID id, SDL_FingerID fingerid, SDL_Window * window,
    5.14                                 float x, float y, float pressure);
    5.15  
    5.16  /* Remove a touch */
     6.1 --- a/src/video/android/SDL_androidtouch.c	Thu Aug 01 17:41:40 2019 +0300
     6.2 +++ b/src/video/android/SDL_androidtouch.c	Thu Aug 01 18:22:12 2019 -0300
     6.3 @@ -69,16 +69,16 @@
     6.4      switch (action) {
     6.5          case ACTION_DOWN:
     6.6          case ACTION_POINTER_DOWN:
     6.7 -            SDL_SendTouch(touchDeviceId, fingerId, SDL_TRUE, x, y, p);
     6.8 +            SDL_SendTouch(touchDeviceId, fingerId, window, SDL_TRUE, x, y, p);
     6.9              break;
    6.10  
    6.11          case ACTION_MOVE:
    6.12 -            SDL_SendTouchMotion(touchDeviceId, fingerId, x, y, p);
    6.13 +            SDL_SendTouchMotion(touchDeviceId, fingerId, window, x, y, p);
    6.14              break;
    6.15  
    6.16          case ACTION_UP:
    6.17          case ACTION_POINTER_UP:
    6.18 -            SDL_SendTouch(touchDeviceId, fingerId, SDL_FALSE, x, y, p);
    6.19 +            SDL_SendTouch(touchDeviceId, fingerId, window, SDL_FALSE, x, y, p);
    6.20              break;
    6.21  
    6.22          default:
     7.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Thu Aug 01 17:41:40 2019 +0300
     7.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Thu Aug 01 18:22:12 2019 -0300
     7.3 @@ -1132,7 +1132,13 @@
     7.4          DLog("Reset Lost Fingers: %d", numFingers);
     7.5          for (--numFingers; numFingers >= 0; --numFingers) {
     7.6              SDL_Finger* finger = SDL_GetTouchFinger(touchID, numFingers);
     7.7 -            SDL_SendTouch(touchID, finger->id, SDL_FALSE, 0, 0, 0);
     7.8 +            /* trackpad touches have no window. If we really wanted one we could
     7.9 +             * use the window that has mouse or keyboard focus.
    7.10 +             * Sending a null window currently also prevents synthetic mouse
    7.11 +             * events from being generated from touch events.
    7.12 +             */
    7.13 +            SDL_Window *window = NULL;
    7.14 +            SDL_SendTouch(touchID, finger->id, window, SDL_FALSE, 0, 0, 0);
    7.15          }
    7.16      }
    7.17  
    7.18 @@ -1167,10 +1173,24 @@
    7.19          const SDL_TouchID touchId = istrackpad ? SDL_MOUSE_TOUCHID : (SDL_TouchID)(intptr_t)[touch device];
    7.20          SDL_TouchDeviceType devtype = SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE;
    7.21  
    7.22 +        /* trackpad touches have no window. If we really wanted one we could
    7.23 +         * use the window that has mouse or keyboard focus.
    7.24 +         * Sending a null window currently also prevents synthetic mouse events
    7.25 +         * from being generated from touch events.
    7.26 +         */
    7.27 +        SDL_Window *window = NULL;
    7.28 +
    7.29  #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101202 /* Added in the 10.12.2 SDK. */
    7.30          if ([touch respondsToSelector:@selector(type)]) {
    7.31 +            /* TODO: Before implementing direct touch support here, we need to
    7.32 +             * figure out whether the OS generates mouse events from them on its
    7.33 +             * own. If it does, we should prevent SendTouch from generating
    7.34 +             * synthetic mouse events for these touches itself (while also
    7.35 +             * sending a window.) It will also need to use normalized window-
    7.36 +             * relative coordinates via [touch locationInView:].
    7.37 +             */
    7.38              if ([touch type] == NSTouchTypeDirect) {
    7.39 -                devtype = SDL_TOUCH_DEVICE_DIRECT;
    7.40 +                return;
    7.41              }
    7.42          }
    7.43  #endif
    7.44 @@ -1187,14 +1207,14 @@
    7.45  
    7.46          switch (phase) {
    7.47          case NSTouchPhaseBegan:
    7.48 -            SDL_SendTouch(touchId, fingerId, SDL_TRUE, x, y, 1.0f);
    7.49 +            SDL_SendTouch(touchId, fingerId, window, SDL_TRUE, x, y, 1.0f);
    7.50              break;
    7.51          case NSTouchPhaseEnded:
    7.52          case NSTouchPhaseCancelled:
    7.53 -            SDL_SendTouch(touchId, fingerId, SDL_FALSE, x, y, 1.0f);
    7.54 +            SDL_SendTouch(touchId, fingerId, window, SDL_FALSE, x, y, 1.0f);
    7.55              break;
    7.56          case NSTouchPhaseMoved:
    7.57 -            SDL_SendTouchMotion(touchId, fingerId, x, y, 1.0f);
    7.58 +            SDL_SendTouchMotion(touchId, fingerId, window, x, y, 1.0f);
    7.59              break;
    7.60          default:
    7.61              break;
     8.1 --- a/src/video/emscripten/SDL_emscriptenevents.c	Thu Aug 01 17:41:40 2019 +0300
     8.2 +++ b/src/video/emscripten/SDL_emscriptenevents.c	Thu Aug 01 18:22:12 2019 -0300
     8.3 @@ -455,16 +455,16 @@
     8.4          y = touchEvent->touches[i].targetY / client_h;
     8.5  
     8.6          if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) {
     8.7 -            SDL_SendTouch(deviceId, id, SDL_TRUE, x, y, 1.0f);
     8.8 +            SDL_SendTouch(deviceId, id, window_data->window, SDL_TRUE, x, y, 1.0f);
     8.9  
    8.10              /* disable browser scrolling/pinch-to-zoom if app handles touch events */
    8.11              if (!preventDefault && SDL_GetEventState(SDL_FINGERDOWN) == SDL_ENABLE) {
    8.12                  preventDefault = 1;
    8.13              }
    8.14          } else if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE) {
    8.15 -            SDL_SendTouchMotion(deviceId, id, x, y, 1.0f);
    8.16 +            SDL_SendTouchMotion(deviceId, id, window_data->window, x, y, 1.0f);
    8.17          } else {
    8.18 -            SDL_SendTouch(deviceId, id, SDL_FALSE, x, y, 1.0f);
    8.19 +            SDL_SendTouch(deviceId, id, window_data->window, SDL_FALSE, x, y, 1.0f);
    8.20  
    8.21              /* block browser's simulated mousedown/mouseup on touchscreen devices */
    8.22              preventDefault = 1;
     9.1 --- a/src/video/uikit/SDL_uikitview.m	Thu Aug 01 17:41:40 2019 +0300
     9.2 +++ b/src/video/uikit/SDL_uikitview.m	Thu Aug 01 18:22:12 2019 -0300
     9.3 @@ -198,7 +198,7 @@
     9.4          /* FIXME, need to send: int clicks = (int) touch.tapCount; ? */
     9.5  
     9.6          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
     9.7 -        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
     9.8 +        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), sdlwindow,
     9.9                        SDL_TRUE, locationInView.x, locationInView.y, pressure);
    9.10      }
    9.11  }
    9.12 @@ -217,7 +217,7 @@
    9.13          /* FIXME, need to send: int clicks = (int) touch.tapCount; ? */
    9.14  
    9.15          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
    9.16 -        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch),
    9.17 +        SDL_SendTouch(touchId, (SDL_FingerID)((size_t)touch), sdlwindow,
    9.18                        SDL_FALSE, locationInView.x, locationInView.y, pressure);
    9.19      }
    9.20  }
    9.21 @@ -239,7 +239,7 @@
    9.22          }
    9.23  
    9.24          CGPoint locationInView = [self touchLocation:touch shouldNormalize:YES];
    9.25 -        SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch),
    9.26 +        SDL_SendTouchMotion(touchId, (SDL_FingerID)((size_t)touch), sdlwindow,
    9.27                              locationInView.x, locationInView.y, pressure);
    9.28      }
    9.29  }
    10.1 --- a/src/video/wayland/SDL_waylandevents.c	Thu Aug 01 17:41:40 2019 +0300
    10.2 +++ b/src/video/wayland/SDL_waylandevents.c	Thu Aug 01 18:22:12 2019 -0300
    10.3 @@ -129,7 +129,7 @@
    10.4  }
    10.5  
    10.6  static void
    10.7 -touch_del(SDL_TouchID id, float* x, float* y)
    10.8 +touch_del(SDL_TouchID id, float* x, float* y, struct wl_surface **surface)
    10.9  {
   10.10      struct SDL_WaylandTouchPoint* tp = touch_points.head;
   10.11  
   10.12 @@ -137,6 +137,7 @@
   10.13          if (tp->id == id) {
   10.14              *x = tp->x;
   10.15              *y = tp->y;
   10.16 +            *surface = tp->surface;
   10.17  
   10.18              if (tp->prev) {
   10.19                  tp->prev->next = tp->next;
   10.20 @@ -407,7 +408,7 @@
   10.21  
   10.22      touch_add(id, x, y, surface);
   10.23  
   10.24 -    SDL_SendTouch(1, (SDL_FingerID)id, SDL_TRUE, x, y, 1.0f);
   10.25 +    SDL_SendTouch(1, (SDL_FingerID)id, window_data->sdlwindow, SDL_TRUE, x, y, 1.0f);
   10.26  }
   10.27  
   10.28  static void
   10.29 @@ -415,9 +416,17 @@
   10.30                   unsigned int timestamp, int id)
   10.31  {
   10.32      float x = 0, y = 0;
   10.33 +    struct wl_surface *surface = NULL;
   10.34 +    SDL_Window *window = NULL;
   10.35  
   10.36 -    touch_del(id, &x, &y);
   10.37 -    SDL_SendTouch(1, (SDL_FingerID)id, SDL_FALSE, x, y, 0.0f);
   10.38 +    touch_del(id, &x, &y, &surface);
   10.39 +
   10.40 +    if (surface) {
   10.41 +        SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(surface);
   10.42 +        window = window_data->sdlwindow;
   10.43 +    }
   10.44 +
   10.45 +    SDL_SendTouch(1, (SDL_FingerID)id, window, SDL_FALSE, x, y, 0.0f);
   10.46  }
   10.47  
   10.48  static void
   10.49 @@ -431,7 +440,7 @@
   10.50      const float y = dbly / window_data->sdlwindow->h;
   10.51  
   10.52      touch_update(id, x, y);
   10.53 -    SDL_SendTouchMotion(1, (SDL_FingerID)id, x, y, 1.0f);
   10.54 +    SDL_SendTouchMotion(1, (SDL_FingerID)id, window_data->sdlwindow, x, y, 1.0f);
   10.55  }
   10.56  
   10.57  static void
    11.1 --- a/src/video/wayland/SDL_waylandtouch.c	Thu Aug 01 17:41:40 2019 +0300
    11.2 +++ b/src/video/wayland/SDL_waylandtouch.c	Thu Aug 01 18:22:12 2019 -0300
    11.3 @@ -96,12 +96,12 @@
    11.4      switch (touchState) {
    11.5          case QtWaylandTouchPointPressed:
    11.6          case QtWaylandTouchPointReleased:
    11.7 -            SDL_SendTouch(deviceId, (SDL_FingerID)id,
    11.8 +            SDL_SendTouch(deviceId, (SDL_FingerID)id, /* FIXME: window */,
    11.9                      (touchState == QtWaylandTouchPointPressed) ? SDL_TRUE : SDL_FALSE,
   11.10                      xf, yf, pressuref);
   11.11              break;
   11.12          case QtWaylandTouchPointMoved:
   11.13 -            SDL_SendTouchMotion(deviceId, (SDL_FingerID)id, xf, yf, pressuref);
   11.14 +            SDL_SendTouchMotion(deviceId, (SDL_FingerID)id, /* FIXME: window */, xf, yf, pressuref);
   11.15              break;
   11.16          default:
   11.17              /* Should not happen */
    12.1 --- a/src/video/windows/SDL_windowsevents.c	Thu Aug 01 17:41:40 2019 +0300
    12.2 +++ b/src/video/windows/SDL_windowsevents.c	Thu Aug 01 18:22:12 2019 -0300
    12.3 @@ -985,13 +985,13 @@
    12.4                      y = (float)(input->y - rect.top)/(rect.bottom - rect.top);
    12.5  
    12.6                      if (input->dwFlags & TOUCHEVENTF_DOWN) {
    12.7 -                        SDL_SendTouch(touchId, input->dwID, SDL_TRUE, x, y, 1.0f);
    12.8 +                        SDL_SendTouch(touchId, input->dwID, data->window, SDL_TRUE, x, y, 1.0f);
    12.9                      }
   12.10                      if (input->dwFlags & TOUCHEVENTF_MOVE) {
   12.11 -                        SDL_SendTouchMotion(touchId, input->dwID, x, y, 1.0f);
   12.12 +                        SDL_SendTouchMotion(touchId, input->dwID, data->window, x, y, 1.0f);
   12.13                      }
   12.14                      if (input->dwFlags & TOUCHEVENTF_UP) {
   12.15 -                        SDL_SendTouch(touchId, input->dwID, SDL_FALSE, x, y, 1.0f);
   12.16 +                        SDL_SendTouch(touchId, input->dwID, data->window, SDL_FALSE, x, y, 1.0f);
   12.17                      }
   12.18                  }
   12.19              }
    13.1 --- a/src/video/winrt/SDL_winrtpointerinput.cpp	Thu Aug 01 17:41:40 2019 +0300
    13.2 +++ b/src/video/winrt/SDL_winrtpointerinput.cpp	Thu Aug 01 18:22:12 2019 -0300
    13.3 @@ -233,6 +233,7 @@
    13.4          SDL_SendTouch(
    13.5              WINRT_TouchID,
    13.6              (SDL_FingerID) pointerPoint->PointerId,
    13.7 +            window,
    13.8              SDL_TRUE,
    13.9              normalizedPoint.X,
   13.10              normalizedPoint.Y,
   13.11 @@ -256,6 +257,7 @@
   13.12          SDL_SendTouchMotion(
   13.13              WINRT_TouchID,
   13.14              (SDL_FingerID) pointerPoint->PointerId,
   13.15 +            window,
   13.16              normalizedPoint.X,
   13.17              normalizedPoint.Y,
   13.18              pointerPoint->Properties->Pressure);
   13.19 @@ -278,6 +280,7 @@
   13.20          SDL_SendTouch(
   13.21              WINRT_TouchID,
   13.22              (SDL_FingerID) pointerPoint->PointerId,
   13.23 +            window,
   13.24              SDL_FALSE,
   13.25              normalizedPoint.X,
   13.26              normalizedPoint.Y,
    14.1 --- a/src/video/x11/SDL_x11xinput2.c	Thu Aug 01 17:41:40 2019 +0300
    14.2 +++ b/src/video/x11/SDL_x11xinput2.c	Thu Aug 01 18:22:12 2019 -0300
    14.3 @@ -230,7 +230,7 @@
    14.4              float x, y;
    14.5              SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event);
    14.6              xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y);
    14.7 -            SDL_SendTouch(xev->sourceid,xev->detail, SDL_TRUE, x, y, 1.0);
    14.8 +            SDL_SendTouch(xev->sourceid,xev->detail, /* FIXME: window */, SDL_TRUE, x, y, 1.0);
    14.9              return 1;
   14.10              }
   14.11              break;
   14.12 @@ -239,7 +239,7 @@
   14.13              float x, y;
   14.14              SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event);
   14.15              xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y);
   14.16 -            SDL_SendTouch(xev->sourceid,xev->detail, SDL_FALSE, x, y, 1.0);
   14.17 +            SDL_SendTouch(xev->sourceid,xev->detail, /* FIXME: window */, SDL_FALSE, x, y, 1.0);
   14.18              return 1;
   14.19              }
   14.20              break;
   14.21 @@ -248,7 +248,7 @@
   14.22              float x, y;
   14.23              SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event);
   14.24              xinput2_normalize_touch_coordinates(window, xev->event_x, xev->event_y, &x, &y);
   14.25 -            SDL_SendTouchMotion(xev->sourceid,xev->detail, x, y, 1.0);
   14.26 +            SDL_SendTouchMotion(xev->sourceid,xev->detail, /* FIXME: window */, x, y, 1.0);
   14.27              return 1;
   14.28              }
   14.29              break;