devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8a2b8ed76a1d7b3f21c10b3d2c3e80e52a1132b6

commit 8a2b8ed76a1d7b3f21c10b3d2c3e80e52a1132b6
Author: Chris Michael <cp.mich...@samsung.com>
Date:   Wed Sep 23 11:13:44 2015 -0400

    ecore-wl2: Add code to send mouse move events
    
    Signed-off-by: Chris Michael <cp.mich...@samsung.com>
---
 src/lib/ecore_wl2/ecore_wl2_input.c | 41 ++++++++++++++++++++++++++++++++-----
 1 file changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c 
b/src/lib/ecore_wl2/ecore_wl2_input.c
index 45f2fd1..decb03f 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -28,8 +28,8 @@ _ecore_wl2_input_mouse_in_send(Ecore_Wl2_Input *input, 
Ecore_Wl2_Window *window)
 
    ev->x = input->pointer.sx;
    ev->y = input->pointer.sy;
-   ev->window = window;
-   ev->event_window = window;
+   ev->window = window->id;
+   ev->event_window = window->id;
    ev->timestamp = input->timestamp;
    ev->modifiers = input->keyboard.modifiers;
 
@@ -46,8 +46,8 @@ _ecore_wl2_input_mouse_out_send(Ecore_Wl2_Input *input, 
Ecore_Wl2_Window *window
 
    ev->x = input->pointer.sx;
    ev->y = input->pointer.sy;
-   ev->window = window;
-   ev->event_window = window;
+   ev->window = window->id;
+   ev->event_window = window->id;
    ev->timestamp = input->timestamp;
    ev->modifiers = input->keyboard.modifiers;
 
@@ -55,6 +55,36 @@ _ecore_wl2_input_mouse_out_send(Ecore_Wl2_Input *input, 
Ecore_Wl2_Window *window
 }
 
 static void
+_ecore_wl2_input_mouse_move_send(Ecore_Wl2_Input *input, Ecore_Wl2_Window 
*window, int device)
+{
+   Ecore_Event_Mouse_Move *ev;
+
+   ev = calloc(1, sizeof(Ecore_Event_Mouse_Move));
+   if (!ev) return;
+
+   ev->window = window->id;
+   ev->event_window = window->id;
+   ev->timestamp = input->timestamp;
+   ev->x = input->pointer.sx;
+   ev->y = input->pointer.sy;
+   ev->root.x = input->pointer.sx;
+   ev->root.y = input->pointer.sy;
+   ev->modifiers = input->keyboard.modifiers;
+   ev->multi.device = device;
+   ev->multi.radius = 1;
+   ev->multi.radius_x = 1;
+   ev->multi.radius_y = 1;
+   ev->multi.pressure = 1.0;
+   ev->multi.angle = 0.0;
+   ev->multi.x = input->pointer.sx;
+   ev->multi.y = input->pointer.sy;
+   ev->multi.root.x = input->pointer.sx;
+   ev->multi.root.y = input->pointer.sy;
+
+   ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+}
+
+static void
 _pointer_cb_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned 
int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy)
 {
    Ecore_Wl2_Input *input;
@@ -123,6 +153,7 @@ _pointer_cb_motion(void *data, struct wl_pointer *pointer 
EINA_UNUSED, unsigned
    window = input->focus.pointer;
    if (!window) return;
 
+   input->timestamp = timestamp;
    input->pointer.sx = wl_fixed_to_double(sx);
    input->pointer.sy = wl_fixed_to_double(sy);
 
@@ -131,7 +162,7 @@ _pointer_cb_motion(void *data, struct wl_pointer *pointer 
EINA_UNUSED, unsigned
    /*     (input->pointer.sy > window->geometry.h)) */
    /*   return; */
 
-   /* TODO: send mouse move event */
+   _ecore_wl2_input_mouse_move_send(input, window, 0);
 }
 
 static void

-- 


Reply via email to