summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland
diff options
context:
space:
mode:
authorJengHyun Kang <jhyuni.kang@samsung.com>2016-06-28 09:01:09 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-06-28 09:01:09 -0400
commit71fab4932578502c169a05350752bc5f85e47cca (patch)
treeee6534f178866ab117757c8e85870cb48d818045 /src/lib/ecore_wayland
parentd8db7b2637528dbc89605720a371b0677c84ae88 (diff)
ecore-wayland: Prevent duplicated mouse up events.
Summary: Prevent duplicated mouse up events generated from input_ungrab. If you touch downs and ups about all of fingers, that is sufficient condition to call ecore_wl_input_ungrab(). And then one mouse up event is generated from that function. So if you set a callback about ECORE_EVENT_MOUSE_BUTTON_UP, you can watch two mouse up events are occurred. Test Plan: Touch and release. And watch mouse up events. Reviewers: raster, zmike, devilhorns Reviewed By: devilhorns Subscribers: ohduna, input.hacker, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4112
Diffstat (limited to 'src/lib/ecore_wayland')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_input.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c
index 6219a033e2..e36f47d1cb 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -164,12 +164,13 @@ ecore_wl_input_ungrab(Ecore_Wl_Input *input)
164 164
165 if (!input) return; 165 if (!input) return;
166 166
167 if ((input->grab) && (input->grab_button)) 167 if ((input->grab) && (input->grab_button) && (input->grab_count))
168 _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button, 168 _ecore_wl_input_mouse_up_send(input, input->grab, 0, input->grab_button,
169 input->grab_timestamp); 169 input->grab_timestamp);
170 170
171 input->grab = NULL; 171 input->grab = NULL;
172 input->grab_button = 0; 172 input->grab_button = 0;
173 input->grab_count = 0;
173} 174}
174 175
175/* NB: This function should be called just before shell move and shell resize 176/* NB: This function should be called just before shell move and shell resize
@@ -622,8 +623,8 @@ _ecore_wl_input_cb_pointer_button(void *data, struct wl_pointer *pointer EINA_UN
622 _ecore_wl_input_mouse_up_send(input, input->pointer_focus, 623 _ecore_wl_input_mouse_up_send(input, input->pointer_focus,
623 0, button, timestamp); 624 0, button, timestamp);
624 625
625 input->grab_count--; 626 if (input->grab_count) input->grab_count--;
626 if ((input->grab) && (input->grab_button == button) && 627 if ((input->grab) && (input->grab_button == button) &&
627 (!state) && (!input->grab_count)) 628 (!state) && (!input->grab_count))
628 ecore_wl_input_ungrab(input); 629 ecore_wl_input_ungrab(input);
629 } 630 }
@@ -1168,8 +1169,8 @@ _ecore_wl_input_cb_touch_up(void *data, struct wl_touch *touch EINA_UNUSED, unsi
1168 input->display->serial = serial; 1169 input->display->serial = serial;
1169 1170
1170 _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp); 1171 _ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp);
1171 input->grab_count--; 1172 if (input->grab_count) input->grab_count--;
1172 if ((input->grab) && (input->grab_button == BTN_LEFT) && 1173 if ((input->grab) && (input->grab_button == BTN_LEFT) &&
1173 (!input->grab_count)) 1174 (!input->grab_count))
1174 ecore_wl_input_ungrab(input); 1175 ecore_wl_input_ungrab(input);
1175} 1176}