summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2017-01-17 12:31:01 -0500
committerChris Michael <cp.michael@samsung.com>2017-01-17 12:31:01 -0500
commit2e0dc2a1f94edc40fc0c1ba938bb92d3c3a4d43f (patch)
treeb3b7a109c293a3e91955e5e29da2b527a4ebc69c /src/lib/ecore_wl2/ecore_wl2_input.c
parent2af4858e2aad8cffac7248398786d37df1a29845 (diff)
ecore-wl2: Add function to get touch device
When we are sending input events, if we have no pointer device then we should be setting ev->dev to a touch device (as touch events are treated as pointer events inside EFL). NB: This allows EFL clients to get touch events in Enlightenment. There are still some small hiccups here (can't close terminology by pressing the 'x' in the corner, cannot scroll elm_test srollbar, etc). Likely EFL needs to change wrt all this...perhaps adding events for touch that are separate from pointer ?... ref T5094 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 3e7fd98753..96665b9091 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -84,6 +84,18 @@ _ecore_wl2_mouse_dev_get(Ecore_Wl2_Input *input, int window_id)
84} 84}
85 85
86static Eo * 86static Eo *
87_ecore_wl2_touch_dev_get(Ecore_Wl2_Input *input, int window_id)
88{
89 Ecore_Wl2_Input_Devices *devices;
90
91 devices = _ecore_wl2_devices_get(input, window_id);
92 if (devices && devices->touch_dev)
93 return efl_ref(devices->touch_dev);
94
95 return NULL;
96}
97
98static Eo *
87_ecore_wl2_seat_dev_get(Ecore_Wl2_Input *input, int window_id) 99_ecore_wl2_seat_dev_get(Ecore_Wl2_Input *input, int window_id)
88{ 100{
89 Ecore_Wl2_Input_Devices *devices; 101 Ecore_Wl2_Input_Devices *devices;
@@ -169,6 +181,8 @@ _ecore_wl2_input_mouse_move_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
169 ev->multi.root.x = input->pointer.sx; 181 ev->multi.root.x = input->pointer.sx;
170 ev->multi.root.y = input->pointer.sy; 182 ev->multi.root.y = input->pointer.sy;
171 ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); 183 ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
184 if (!ev->dev)
185 ev->dev = _ecore_wl2_touch_dev_get(input, window->id);
172 186
173 info = _ecore_wl2_input_mouse_down_info_get(device); 187 info = _ecore_wl2_input_mouse_down_info_get(device);
174 if (info) 188 if (info)
@@ -214,7 +228,15 @@ _ecore_wl2_input_mouse_wheel_send(Ecore_Wl2_Input *input, unsigned int axis, int
214 ev->window = input->focus.pointer->id; 228 ev->window = input->focus.pointer->id;
215 ev->event_window = input->focus.pointer->id; 229 ev->event_window = input->focus.pointer->id;
216 } 230 }
231 else if (input->focus.touch)
232 {
233 ev->window = input->focus.touch->id;
234 ev->event_window = input->focus.touch->id;
235 }
236
217 ev->dev = _ecore_wl2_mouse_dev_get(input, ev->window); 237 ev->dev = _ecore_wl2_mouse_dev_get(input, ev->window);
238 if (!ev->dev)
239 ev->dev = _ecore_wl2_touch_dev_get(input, ev->window);
218 240
219 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, _input_event_cb_free, ev->dev); 241 ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, _input_event_cb_free, ev->dev);
220} 242}
@@ -305,6 +327,8 @@ _ecore_wl2_input_mouse_down_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *windo
305 ev->window = window->id; 327 ev->window = window->id;
306 ev->event_window = window->id; 328 ev->event_window = window->id;
307 ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); 329 ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
330 if (!ev->dev)
331 ev->dev = _ecore_wl2_touch_dev_get(input, window->id);
308 } 332 }
309 333
310 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, 334 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev,
@@ -377,6 +401,8 @@ _ecore_wl2_input_mouse_up_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window,
377 ev->window = window->id; 401 ev->window = window->id;
378 ev->event_window = window->id; 402 ev->event_window = window->id;
379 ev->dev = _ecore_wl2_mouse_dev_get(input, window->id); 403 ev->dev = _ecore_wl2_mouse_dev_get(input, window->id);
404 if (!ev->dev)
405 ev->dev = _ecore_wl2_touch_dev_get(input, window->id);
380 406
381 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, 407 ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev,
382 _input_event_cb_free, ev->dev); 408 _input_event_cb_free, ev->dev);