Add event handler for mouse_move (from X) so we can pass this along to
authorChris Michael <cp.michael@samsung.com>
Thu, 13 Jun 2013 13:51:07 +0000 (14:51 +0100)
committerChris Michael <cp.michael@samsung.com>
Thu, 13 Jun 2013 13:51:07 +0000 (14:51 +0100)
wayland

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/wl_x11/e_mod_main.c

index ad39df7120f0790fa7884365d7125d690f5f226c..bb8d62ccd3a111b91a3a5f418c5d218dba999efc 100644 (file)
@@ -14,6 +14,7 @@ static void _output_cb_repaint_shm(E_Output *output, pixman_region32_t *damage);
 static void _output_cb_destroy(E_Output *output);
 static Eina_Bool _output_cb_window_damage(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
 static Eina_Bool _output_cb_window_destroy(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
+static Eina_Bool _output_cb_window_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event);
 
 /* local variables */
 static E_Compositor_X11 *_e_x11_comp;
@@ -75,6 +76,8 @@ e_modapi_init(E_Module *m)
                          _output_cb_window_damage, NULL);
    E_LIST_HANDLER_APPEND(_hdlrs, ECORE_X_EVENT_WINDOW_DELETE_REQUEST, 
                          _output_cb_window_destroy, NULL);
+   E_LIST_HANDLER_APPEND(_hdlrs, ECORE_EVENT_MOUSE_MOVE, 
+                         _output_cb_window_mouse_move, NULL);
 
    /* flush any pending events
     * 
@@ -417,3 +420,26 @@ _output_cb_window_destroy(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev
 
    return ECORE_CALLBACK_PASS_ON;
 }
+
+static Eina_Bool 
+_output_cb_window_mouse_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+{
+   Ecore_Event_Mouse_Move *ev;
+   E_Output_X11 *output;
+   Eina_List *l;
+
+   ev = event;
+
+   /* loop the existing outputs */
+   EINA_LIST_FOREACH(_e_x11_comp->base.outputs, l, output)
+     {
+        /* try to match the output window */
+        if (ev->window == output->win)
+          {
+             e_input_mouse_move_send(&_e_x11_comp->seat, ev);
+             break;
+          }
+     }
+
+   return ECORE_CALLBACK_PASS_ON;
+}