ecore-wl2: Start on code for pointer leave event
authorChris Michael <cp.michael@samsung.com>
Thu, 10 Sep 2015 17:25:54 +0000 (13:25 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 3 Dec 2015 17:02:40 +0000 (12:02 -0500)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wl2/ecore_wl2_input.c

index 77d063e..ee95a21 100644 (file)
@@ -25,6 +25,7 @@ _pointer_cb_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned i
    if (!window) return;
 
    input->focus.pointer = window;
+
    /* TODO: send mouse in event */
 }
 
@@ -32,9 +33,21 @@ static void
 _pointer_cb_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface)
 {
    Ecore_Wl2_Input *input;
+   Ecore_Wl2_Window *window;
 
    input = data;
    if (!input) return;
+
+   input->focus.pointer = NULL;
+
+   /* trap for a surface that was just destroyed */
+   if (!surface) return;
+
+   /* find the window which this surface belongs to */
+   window = _ecore_wl2_display_window_surface_find(input->display, surface);
+   if (!window) return;
+
+   /* TODO: send mouse out event */
 }
 
 static void