summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-11-03 15:10:38 -0500
committerChris Michael <cp.michael@samsung.com>2014-11-03 15:10:38 -0500
commit2d7ca6d2ebf86c84fbfde5381ff7f18808895d56 (patch)
tree532938ccde611774bab007626919b0c2a1cd9f4d
parent9ebf046e416880cd2093ce2b3ccaa4bd6389a188 (diff)
downloadenlightenment-2d7ca6d2ebf86c84fbfde5381ff7f18808895d56.tar.gz
e-comp-wl: Implement callback for surface resource destroy
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/e_comp_wl.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 39766773c3..a0901e611f 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -1055,6 +1055,23 @@ static const struct wl_surface_interface _e_surface_interface =
};
static void
+_e_comp_wl_surface_destroy(struct wl_resource *resource)
+{
+ E_Pixmap *ep;
+ E_Client *ec;
+
+ if (!(ep = wl_resource_get_user_data(resource))) return;
+
+ /* try to get the e_client from this pixmap */
+ if (!(ec = e_pixmap_client_get(ep)))
+ ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, e_pixmap_window_get(ep));
+
+ if (!ec) return;
+
+ e_object_del(E_OBJECT(ec));
+}
+
+static void
_e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_resource *resource, uint32_t id)
{
E_Comp *comp;
@@ -1079,8 +1096,8 @@ _e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_reso
DBG("\tCreated Resource: %d", wl_resource_get_id(res));
/* set implementation on resource */
- wl_resource_set_implementation(res, &_e_surface_interface, NULL, NULL);
-// _callback);
+ wl_resource_set_implementation(res, &_e_surface_interface, NULL,
+ _e_comp_wl_surface_destroy);
/* get the client pid and generate a pixmap id */
wl_client_get_credentials(client, &pid, NULL, NULL);
@@ -1266,6 +1283,8 @@ _e_comp_wl_subsurface_destroy(struct wl_resource *resource)
/* try to get the client from resource data */
if (!(ec = wl_resource_get_user_data(resource))) return;
+ if (!ec->comp_data) return;
+
if (!(sdata = ec->comp_data->sub.data)) return;
if (sdata->parent)
@@ -1726,8 +1745,6 @@ _e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl
sdata->synchronized = EINA_TRUE;
sdata->parent = epc;
- ec->comp_data->sub.data = sdata;
-
/* create subsurface tilers */
sdata->cached.input = eina_tiler_new(ec->w, ec->h);
eina_tiler_tile_size_set(sdata->cached.input, 1, 1);
@@ -1747,6 +1764,8 @@ _e_comp_wl_subsurface_create(E_Client *ec, E_Client *epc, uint32_t id, struct wl
/* TODO: add callbacks ?? */
}
+ ec->comp_data->sub.data = sdata;
+
return EINA_TRUE;
res_err: