e_compositor: Add e_subsurface_destroy_listener_add() 28/313428/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 21 May 2024 05:06:03 +0000 (14:06 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 26 Jun 2024 00:34:33 +0000 (09:34 +0900)
Change-Id: I0084d271ba6ef303f06ccdb4754fde1357ecca0a

src/bin/server/e_compositor.c
src/bin/server/e_compositor_intern.h

index 9e6df257fef36d1e25461f07f59d845296b86e59..e0c69a3af65b3272bb6419327b9daad73f28a6bf 100644 (file)
@@ -63,6 +63,11 @@ struct _E_Subsurface
    struct wl_listener parent_surface_destroy;
    struct wl_listener cached;
    struct wl_listener request_move;
+
+   struct
+     {
+        struct wl_signal destroy;
+     } events;
 };
 
 struct _E_Frame_Callback
@@ -1315,6 +1320,8 @@ _e_subsurface_create(struct ds_subsurface *ds_subsurface, E_Surface *parent_surf
         return NULL;
      }
 
+   wl_signal_init(&sub->events.destroy);
+
    sub->ds_subsurface = ds_subsurface;
    sub->destroy.notify = _e_subsurface_cb_destroy;
    wl_signal_add(&ds_subsurface->events.destroy, &sub->destroy);
@@ -1349,6 +1356,9 @@ static void
 _e_subsurface_destroy(E_Subsurface *sub)
 {
    ELOGF("SUBSURFACE", "Destroy", sub->surface->ec);
+
+   wl_signal_emit(&sub->events.destroy, sub);
+
    e_comp_wl_client_subsurface_finish(sub->surface->ec);
    wl_list_remove(&sub->request_move.link);
    wl_list_remove(&sub->parent_surface_destroy.link);
@@ -1592,3 +1602,10 @@ e_subsurface_from_resource(struct wl_resource *resource)
 
    return subsurface;
 }
+
+EINTERN void
+e_subsurface_destroy_listener_add(E_Subsurface *subsurface, struct wl_listener *listener)
+{
+   EINA_SAFETY_ON_NULL_RETURN(subsurface);
+   wl_signal_add(&subsurface->events.destroy, listener);
+}
\ No newline at end of file
index 7fafe3efdef63431bf15b2e7c75bcdea6d7f6ce7..c3567e97f431361ba07066eecbc0f423311ff8e2 100644 (file)
@@ -28,5 +28,6 @@ EINTERN Eina_Bool e_surface_viewport_changed_get(E_Surface *surface);
 EINTERN E_Subsurface *e_subsurface_from_resource(struct wl_resource *resource);
 EINTERN E_Subsurface *e_subsurface_from_surface(E_Surface *surface);
 EINTERN Eina_Bool e_subsurface_position_set(E_Subsurface *subsurface, int x, int y);
+EINTERN void e_subsurface_destroy_listener_add(E_Subsurface *subsurface, struct wl_listener *listener);
 
 #endif