Add function to find a surface based on x/y
authorChris Michael <cp.michael@samsung.com>
Thu, 13 Jun 2013 13:48:44 +0000 (14:48 +0100)
committerChris Michael <cp.michael@samsung.com>
Thu, 13 Jun 2013 13:48:44 +0000 (14:48 +0100)
Use wl_display_terminate instead of destroy

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/bin/e_wayland/e_comp.c
src/bin/e_wayland/e_comp.h

index 21018fe4a8ab4d5e47d44bdfbc5575d085a09b4a..c9071794ad9a850d93120bf1b486e7aa728a4586 100644 (file)
@@ -264,7 +264,7 @@ e_compositor_shutdown(E_Compositor *comp)
    if (comp->fd_hdlr) ecore_main_fd_handler_del(comp->fd_hdlr);
 
    /* destroy the previously created display */
-   if (comp->wl.display) wl_display_destroy(comp->wl.display);
+   if (comp->wl.display) wl_display_terminate(comp->wl.display);
 
    return EINA_TRUE;
 }
@@ -342,6 +342,21 @@ e_compositor_get_time(void)
    return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
 }
 
+EAPI E_Surface *
+e_compositor_surface_find(E_Compositor *comp, Evas_Coord x, Evas_Coord y)
+{
+   E_Surface *es;
+   Eina_List *l;
+
+   EINA_LIST_FOREACH(comp->surfaces, l, es)
+     {
+        if (pixman_region32_contains_point(&es->input, x, y, NULL))
+          return es;
+     }
+
+   return NULL;
+}
+
 /* local functions */
 static void 
 _e_comp_cb_bind(struct wl_client *client, void *data, unsigned int version EINA_UNUSED, unsigned int id)
@@ -369,7 +384,7 @@ _e_comp_cb_surface_create(struct wl_client *client, struct wl_resource *resource
    E_Compositor *comp;
    E_Surface *es;
 
-   printf("E_Comp Surface Create\n");
+   printf("E_Comp Surface Create: %d\n", id);
 
    /* try to cast to our compositor */
    if (!(comp = resource->data)) return;
index c5e602dc223635fccfdc4d553fbf795c9c9e2d39..a76273da001502b651c29035366ab3b15475ff63 100644 (file)
@@ -67,6 +67,7 @@ EAPI void e_compositor_plane_stack(E_Compositor *comp, E_Plane *plane, E_Plane *
 EAPI int e_compositor_input_read(int fd EINA_UNUSED, unsigned int mask EINA_UNUSED, void *data);
 EAPI void e_compositor_damage_calculate(E_Compositor *comp);
 EAPI unsigned int e_compositor_get_time(void);
+EAPI E_Surface *e_compositor_surface_find(E_Compositor *comp, Evas_Coord x, Evas_Coord y);
 
 # endif
 #endif