ecore_wayland: send mouse_move when sets touch_focus window in cb_touch_down

Summary:
When user touches the screen, ecore_drm generates MOUSE_MOVE event before MOUSE_BUTTON_DOWN.
But when ecore_wayland gets touch_motion before touch_down, touch_focus window is NULL and sending MOUSE_MOVE event fails.
Also in terms of 'touch' input, touch_focus needs be set in cb_touch_down, not in cb_pointer_enter.
So this commit makes sure that ecore_wayland generates MOUSE_MOVE when touch_focus is set.

@fix

Test Plan:
when the application is launched for first time, user clicks on any area of the screen.
We can see the posion of touch event wrong.

Reviewers: raster, zmike, devilhorns, gwanglim, ManMower

Reviewed By: ManMower

Subscribers: jpeg, JHyun, cedric, input.hacker

Differential Revision: https://phab.enlightenment.org/D3555
This commit is contained in:
Duna Oh 2016-01-13 10:10:05 -05:00 committed by Chris Michael
parent 6d16bdf2c9
commit 49ef37457a
1 changed files with 6 additions and 3 deletions

View File

@ -987,7 +987,6 @@ _ecore_wl_input_cb_pointer_enter(void *data, struct wl_pointer *pointer EINA_UNU
{
win->pointer_device = input;
input->pointer_focus = win;
input->touch_focus = win;
if (win->pointer.set)
{
@ -1117,13 +1116,17 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch EINA_UNUSED, un
if (!(win = ecore_wl_window_surface_find(surface))) return;
input->touch_focus = win;
input->timestamp = timestamp;
input->display->serial = serial;
input->sx = wl_fixed_to_int(x);
input->sy = wl_fixed_to_int(y);
//_ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
if (input->touch_focus != win)
{
input->touch_focus = win;
_ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
}
if (!input->grab_count)
{
_ecore_wl_input_cb_pointer_enter(data, NULL, serial, surface, x, y);