ecore_wl2: only ungrab/grab on last/first down/up event
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Mon, 27 Jan 2020 16:23:13 +0000 (11:23 -0500)
committerJongmin Lee <jm105.lee@samsung.com>
Mon, 27 Jan 2020 21:06:49 +0000 (06:06 +0900)
Summary: otherwise we are silently forgetting about up events.

Reviewers: zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11199

src/lib/ecore_wl2/ecore_wl2_input.c

index 493b31a..585a8f0 100644 (file)
@@ -1648,7 +1648,7 @@ _touch_cb_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int seri
 
    input->grab.count++;
 
-   if ((!input->grab.window) && (input->focus.touch))
+   if ((!input->grab.window) && (input->focus.touch) && input->grab.touch_count == 1)
      {
         _pointer_cb_enter(data, NULL, serial, surface, x, y);
         _ecore_wl2_input_grab(input, input->focus.touch, BTN_LEFT);
@@ -1687,7 +1687,7 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial
    if (input->grab.count) input->grab.count--;
    if (input->grab.touch_count) input->grab.touch_count--;
    if ((input->grab.window) && (input->grab.button == BTN_LEFT) &&
-       (!input->grab.count))
+       (!input->grab.count) && !input->grab.touch_count)
      _ecore_wl2_input_ungrab(input);
 
    if (input->grab.touch_count == 0) input->focus.touch = NULL;