uint32_t single_pixel;
+ struct wl_listener surface_resource_destroy;
+
struct {
struct wl_signal buffer_clear;
struct wl_signal buffer_clear_done;
if (cp->buffer)
wl_list_remove(&cp->buffer_destroy_listener.link);
+ wl_list_remove(&cp->surface_resource_destroy.link);
free(cp);
}
return cp;
}
+static void
+_e_pixmap_cb_surface_resource_destroy(struct wl_listener *listener, void *data)
+{
+ E_Pixmap *cp = wl_container_of(listener, cp, surface_resource_destroy);
+
+ e_pixmap_win_id_del(cp);
+ wl_list_remove(&cp->surface_resource_destroy.link);
+ wl_list_init(&cp->surface_resource_destroy.link);
+}
+
+static void
+_e_pixmap_id_setup(E_Pixmap *cp, uintptr_t id)
+{
+ cp->win = id;
+ eina_hash_add(pixmaps[cp->type], &id, cp);
+
+ if (cp->type == E_PIXMAP_TYPE_WL)
+ {
+ cp->surface_resource_destroy.notify = _e_pixmap_cb_surface_resource_destroy;
+ wl_resource_add_destroy_listener((struct wl_resource *)id, &cp->surface_resource_destroy);
+ }
+ else
+ {
+ wl_list_init(&cp->surface_resource_destroy.link);
+ }
+}
+
E_API E_Pixmap *
e_pixmap_new(E_Pixmap_Type type, ...)
{
return NULL;
}
- cp->win = id;
- eina_hash_add(pixmaps[type], &id, cp);
+ _e_pixmap_id_setup(cp, id);
uuid_generate(cp->uuid);
if (!res_ids)
e_comp_wl_client_surface_set(ec, NULL);
ec->comp_data->wl_surface = NULL;
- e_pixmap_win_id_del(ec->pixmap);
_e_comp_wl_surface_render_stop(ec);
e_object_del(E_OBJECT(ec));
internal = 1;
ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, (uintptr_t)wl_resource_get_id(surface_resource));
}
- else if ((ep = e_pixmap_find(E_PIXMAP_TYPE_WL, (uintptr_t)surface_resource)))
- {
- ERR("There is e_pixmap already, Delete old e_pixmap %p", ep);
- e_pixmap_win_id_del(ep);
- }
if (!ec)
{