summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2019-04-30 11:27:25 -0400
committerChristopher Michael <cp.michael@samsung.com>2019-04-30 11:27:25 -0400
commitb376391078958f9457c10704527dcdff5ec7dd18 (patch)
treed2ead5d692cb34bda74c0024cf72c6dcc4b90357 /src/lib/ecore_wl2/ecore_wl2_input.c
parent703ca74d67d377d8901f94e0ff09320234f6d7c9 (diff)
wl2_input: fix a problem that occurs in case of using both pointer/touch input devices
Summary: if wl2_input logic gets a 'touch down' event from touch device, input->focus.touch has set and it cause the logic handles every input as touch input from that moment at _ecore_wl2_input_mouse_move_send function. that is the reason why the patch(410c1f95879e46a5e52132662d4c43b74e95a251) has written for. however, if there are multiple touch input devices, clearing focus.touch variable without checking any conditions causes another problem. I mean a case such as 'touch 1 down' -> 'touch 2 down' -> 'touch 1 up' -> 'touch 2 up' at the moment 'touch 1 up' event executed, focus.touch would be cleared, and 'touch 2 up' and following touch events will not be executed properly at the moment. this patch counts a number of touch devices which are grabbing to clear focus.touch at proper time. Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8787
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index fb50d04117..67a2dcba80 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -671,6 +671,7 @@ _ecore_wl2_input_ungrab(Ecore_Wl2_Input *input)
671 input->grab.window = NULL; 671 input->grab.window = NULL;
672 input->grab.button = 0; 672 input->grab.button = 0;
673 input->grab.count = 0; 673 input->grab.count = 0;
674 input->grab.touch_count = 0;
674} 675}
675 676
676static void 677static void
@@ -1210,6 +1211,7 @@ _touch_cb_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int seri
1210 1211
1211 input->focus.touch = window; 1212 input->focus.touch = window;
1212 input->timestamp = timestamp; 1213 input->timestamp = timestamp;
1214 input->grab.touch_count++;
1213 1215
1214 _pointer_cb_enter(data, NULL, serial, surface, x, y); 1216 _pointer_cb_enter(data, NULL, serial, surface, x, y);
1215 1217
@@ -1239,11 +1241,13 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial
1239 BTN_LEFT, timestamp); 1241 BTN_LEFT, timestamp);
1240 1242
1241 if (input->grab.count) input->grab.count--; 1243 if (input->grab.count) input->grab.count--;
1244 if (input->grab.touch_count) input->grab.touch_count--;
1242 if ((input->grab.window) && (input->grab.button == BTN_LEFT) && 1245 if ((input->grab.window) && (input->grab.button == BTN_LEFT) &&
1243 (!input->grab.count)) 1246 (!input->grab.count))
1244 _ecore_wl2_input_ungrab(input); 1247 _ecore_wl2_input_ungrab(input);
1245 1248
1246 input->focus.touch = NULL; 1249 if (input->grab.touch_count == 0) input->focus.touch = NULL;
1250
1247} 1251}
1248 1252
1249static void 1253static void