Bug 4576: remove touch/mouse duplication for Wayland
authorSylvain Becker <sylvain.becker@gmail.com>
Tue, 02 Apr 2019 17:07:54 +0200
changeset 12679108f8fab6175
parent 12678 9fdfbf246f09
child 12680 798c467b33c9
Bug 4576: remove touch/mouse duplication for Wayland
src/video/wayland/SDL_waylandevents.c
src/video/wayland/SDL_waylandwindow.h
     1.1 --- a/src/video/wayland/SDL_waylandevents.c	Tue Apr 02 17:03:58 2019 +0200
     1.2 +++ b/src/video/wayland/SDL_waylandevents.c	Tue Apr 02 17:07:54 2019 +0200
     1.3 @@ -407,13 +407,6 @@
     1.4  
     1.5      touch_add(id, x, y, surface);
     1.6  
     1.7 -    if (!window_data->finger_touching) {
     1.8 -        window_data->finger_touching = SDL_TRUE;
     1.9 -        window_data->first_finger = id;
    1.10 -        SDL_SendMouseMotion(window_data->sdlwindow, SDL_TOUCH_MOUSEID, 0, (int) dblx, (int) dbly);
    1.11 -        SDL_SendMouseButton(window_data->sdlwindow, SDL_TOUCH_MOUSEID, SDL_PRESSED, SDL_BUTTON_LEFT);
    1.12 -    }
    1.13 -
    1.14      SDL_SendTouch(1, (SDL_FingerID)id, SDL_TRUE, x, y, 1.0f);
    1.15  }
    1.16  
    1.17 @@ -424,11 +417,6 @@
    1.18      SDL_WindowData *window_data = (SDL_WindowData *)wl_surface_get_user_data(touch_surface(id));
    1.19      float x = 0, y = 0;
    1.20  
    1.21 -    if ((window_data->finger_touching) && (window_data->first_finger == id)) {
    1.22 -        SDL_SendMouseButton(window_data->sdlwindow, SDL_TOUCH_MOUSEID, SDL_RELEASED, SDL_BUTTON_LEFT);
    1.23 -        window_data->finger_touching = SDL_FALSE;
    1.24 -    }
    1.25 -
    1.26      touch_del(id, &x, &y);
    1.27      SDL_SendTouch(1, (SDL_FingerID)id, SDL_FALSE, x, y, 0.0f);
    1.28  }
    1.29 @@ -443,10 +431,6 @@
    1.30      const float x = dblx / window_data->sdlwindow->w;
    1.31      const float y = dbly / window_data->sdlwindow->h;
    1.32  
    1.33 -    if ((window_data->finger_touching) && (window_data->first_finger == id)) {
    1.34 -        SDL_SendMouseMotion(window_data->sdlwindow, SDL_TOUCH_MOUSEID, 0, (int) dblx, (int) dbly);
    1.35 -    }
    1.36 -
    1.37      touch_update(id, x, y);
    1.38      SDL_SendTouchMotion(1, (SDL_FingerID)id, x, y, 1.0f);
    1.39  }
     2.1 --- a/src/video/wayland/SDL_waylandwindow.h	Tue Apr 02 17:03:58 2019 +0200
     2.2 +++ b/src/video/wayland/SDL_waylandwindow.h	Tue Apr 02 17:07:54 2019 +0200
     2.3 @@ -76,8 +76,6 @@
     2.4          int width, height;
     2.5      } resize;
     2.6  
     2.7 -    SDL_bool finger_touching;  /* for mapping touch events to mice */
     2.8 -    SDL_FingerID first_finger;
     2.9  } SDL_WindowData;
    2.10  
    2.11  extern void Wayland_ShowWindow(_THIS, SDL_Window *window);