From: Seunghun Lee Date: Thu, 13 Jun 2024 03:30:12 +0000 (+0900) Subject: compositor: Add destroy signal of E_Surface X-Git-Tag: accepted/tizen/8.0/unified/20240705.163555~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F74%2F313774%2F1;p=platform%2Fupstream%2Fenlightenment.git compositor: Add destroy signal of E_Surface As a thin wrapper of ds_surface, E_Surface is bound to ds_surface. That is, E_Surface become inert if ds_surface is destroyed. E_Surface should be separated from the life cycle of E_Client, but it's hard to do it for now because E_Surface is tightly coupled with E_Client - It provides many functionalities related to comp_data member variable of E_Client. So, let the destroy signal of E_Surface emit when the destroy signal of ds_surface is emitted. Change-Id: Ie5cf65a20c9765e78b8d1caecfd20883b464357f --- diff --git a/src/bin/e_compositor.c b/src/bin/e_compositor.c index ea09ac519f..eb9747a900 100644 --- a/src/bin/e_compositor.c +++ b/src/bin/e_compositor.c @@ -37,6 +37,7 @@ struct _E_Surface struct { + struct wl_signal destroy; struct wl_signal parent_destroy; } events; }; @@ -256,13 +257,13 @@ e_surface_from_resource(struct wl_resource *surface_resource) EINTERN void e_surface_destroy_listener_add(E_Surface *surface, struct wl_listener *listener) { - wl_signal_add(&surface->base.destroy_signal, listener); + wl_signal_add(&surface->events.destroy, listener); } EINTERN struct wl_listener * e_surface_destroy_listener_get(E_Surface *surface, wl_notify_func_t notify) { - return wl_signal_get(&surface->base.destroy_signal, notify); + return wl_signal_get(&surface->events.destroy, notify); } EINTERN void @@ -651,6 +652,7 @@ _e_surface_create(E_Client *ec) e_object_ref(E_OBJECT(ec)); surface->ec = ec; + wl_signal_init(&surface->events.destroy); wl_signal_init(&surface->events.parent_destroy); wl_signal_init(&surface->base.destroy_signal); wl_signal_init(&surface->base.apply_viewport_signal); @@ -1230,11 +1232,7 @@ _e_surface_cb_destroy(struct wl_listener *listener, void *data) surface = wl_container_of(listener, surface, destroy); - if (surface->surface_viewport) - { - ds_surface_viewport_release(surface->surface_viewport); - surface->surface_viewport = NULL; - } + wl_signal_emit(&surface->events.destroy, surface); wl_list_remove(&surface->destroy.link); wl_list_remove(&surface->commit.link);