From f85504cd6c1d9090a04af14889954dfb7eda30d8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 17 Feb 2016 13:14:38 -0500 Subject: [PATCH] ecore-wl2: do not send double mouse up events during input ungrab if the ungrab is triggered from a mouse up event, this ensures that a mouse up will be sent from the ungrab function. continuing to send a mouse up event in addition to this will guarantee multiple mouse events are emitted @fix --- src/lib/ecore_wl2/ecore_wl2_input.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c index 9d0301a0d6..f3623258c1 100644 --- a/src/lib/ecore_wl2/ecore_wl2_input.c +++ b/src/lib/ecore_wl2/ecore_wl2_input.c @@ -573,12 +573,11 @@ _pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned } else { - if (input->focus.pointer) - _ecore_wl2_input_mouse_up_send(input, input->focus.pointer, - 0, button, timestamp); - if ((input->grab.window) && (input->grab.button == button)) _ecore_wl2_input_ungrab(input); + else if (input->focus.pointer) + _ecore_wl2_input_mouse_up_send(input, input->focus.pointer, + 0, button, timestamp); } } @@ -953,11 +952,11 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial input->timestamp = timestamp; input->display->serial = serial; - _ecore_wl2_input_mouse_up_send(input, input->focus.touch, id, - BTN_LEFT, timestamp); - if ((input->grab.window) && (input->grab.button == BTN_LEFT)) _ecore_wl2_input_ungrab(input); + else + _ecore_wl2_input_mouse_up_send(input, input->focus.touch, id, + BTN_LEFT, timestamp); } static void