ecore_wayland: send mouse_move when sets touch_focus window in cb_touch_down 26/56526/2
authorDuna Oh <duna.oh@samsung.com>
Mon, 11 Jan 2016 02:14:36 +0000 (11:14 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Wed, 13 Jan 2016 04:00:28 +0000 (20:00 -0800)
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.

Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: I721c0dc7248a885c57c64d3957e0bd84cd7ce1bd

src/lib/ecore_wayland/ecore_wl_input.c

index 96eca70..ac7ff50 100644 (file)
@@ -1044,7 +1044,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)
           {
@@ -1172,13 +1171,16 @@ _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);
+   if (input->touch_focus != win)
+     {
+        input->touch_focus = win;
+        _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
+     }
 
-   //_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);