From: JengHyun Kang Date: Wed, 29 Jun 2016 08:33:04 +0000 (+0900) Subject: ecore-wayland: Prevent duplicated mouse up events. X-Git-Tag: accepted/tizen/common/20160703.131020~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2a63099cef92cefea92a4be7431ae5bc135903b;p=platform%2Fupstream%2Fefl.git ecore-wayland: Prevent duplicated mouse up events. Change-Id: Ibb3d6ee20ee1f7413e8e1d7f34ccc8b29f913b44 --- diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index 7ae42d9..e667e8b 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c @@ -202,12 +202,13 @@ ecore_wl_input_ungrab(Ecore_Wl_Input *input) if (!input) return; - if ((input->grab) && (input->grab_button)) + if ((input->grab) && (input->grab_button) && (input->grab_count)) _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, input->grab_timestamp); input->grab = NULL; input->grab_button = 0; + input->grab_count = 0; } /* NB: This function should be called just before shell move and shell resize @@ -759,7 +760,7 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN _ecore_wl_input_mouse_up_send(input, input->pointer_focus, 0, button, timestamp); - input->grab_count--; + if (input->grab_count) input->grab_count--; if ((input->grab) && (input->grab_button == button) && (!state) && (!input->grab_count)) ecore_wl_input_ungrab(input); @@ -1466,7 +1467,7 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsi input->display->serial = serial; _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp); - input->grab_count--; + if (input->grab_count) input->grab_count--; if ((input->grab) && (input->grab_button == BTN_LEFT) && (!input->grab_count)) ecore_wl_input_ungrab(input);