Bug 4576: remove touch/mouse duplication for WinRT
authorSylvain Becker <sylvain.becker@gmail.com>
Tue, 02 Apr 2019 17:13:22 +0200
changeset 12681450b42f2f24c
parent 12680 798c467b33c9
child 12682 aec854f934db
Bug 4576: remove touch/mouse duplication for WinRT
src/video/winrt/SDL_winrtpointerinput.cpp
     1.1 --- a/src/video/winrt/SDL_winrtpointerinput.cpp	Tue Apr 02 17:10:29 2019 +0200
     1.2 +++ b/src/video/winrt/SDL_winrtpointerinput.cpp	Tue Apr 02 17:13:22 2019 +0200
     1.3 @@ -38,7 +38,6 @@
     1.4  
     1.5  /* File-specific globals: */
     1.6  static SDL_TouchID WINRT_TouchID = 1;
     1.7 -static unsigned int WINRT_LeftFingerDown = 0;
     1.8  
     1.9  
    1.10  void
    1.11 @@ -231,15 +230,6 @@
    1.12          Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
    1.13          Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize);
    1.14  
    1.15 -        if (!WINRT_LeftFingerDown) {
    1.16 -            if (button) {
    1.17 -                SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y);
    1.18 -                SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_PRESSED, button);
    1.19 -            }
    1.20 -
    1.21 -            WINRT_LeftFingerDown = pointerPoint->PointerId;
    1.22 -        }
    1.23 -
    1.24          SDL_SendTouch(
    1.25              WINRT_TouchID,
    1.26              (SDL_FingerID) pointerPoint->PointerId,
    1.27 @@ -263,10 +253,6 @@
    1.28      if ( ! WINRT_IsTouchEvent(pointerPoint)) {
    1.29          SDL_SendMouseMotion(window, 0, 0, (int)windowPoint.X, (int)windowPoint.Y);
    1.30      } else {
    1.31 -        if (pointerPoint->PointerId == WINRT_LeftFingerDown) {
    1.32 -            SDL_SendMouseMotion(window, SDL_TOUCH_MOUSEID, 0, (int)windowPoint.X, (int)windowPoint.Y);
    1.33 -        }
    1.34 -
    1.35          SDL_SendTouchMotion(
    1.36              WINRT_TouchID,
    1.37              (SDL_FingerID) pointerPoint->PointerId,
    1.38 @@ -289,13 +275,6 @@
    1.39      } else {
    1.40          Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne);
    1.41  
    1.42 -        if (WINRT_LeftFingerDown == pointerPoint->PointerId) {
    1.43 -            if (button) {
    1.44 -                SDL_SendMouseButton(window, SDL_TOUCH_MOUSEID, SDL_RELEASED, button);
    1.45 -            }
    1.46 -            WINRT_LeftFingerDown = 0;
    1.47 -        }
    1.48 -
    1.49          SDL_SendTouch(
    1.50              WINRT_TouchID,
    1.51              (SDL_FingerID) pointerPoint->PointerId,