viewport: Use E_Surface's destroy signal instead of surface wl_resource's 20/304820/2
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 18 Jan 2024 04:12:00 +0000 (13:12 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 24 Jan 2024 04:21:17 +0000 (04:21 +0000)
It replaces the use of the destroy signal from the surface wl_resource
with E_Surface's destroy signal. Since E_Surface acts as a wrapper
around surface wl_resource, it makes more sense to utilize its signals
instead.

Change-Id: Ib02535c9243bbe96d1ca624bf1fd4143deeebe88

src/bin/e_comp_wl_viewport.c

index ac98620..2eff0c0 100644 (file)
@@ -1659,13 +1659,6 @@ e_comp_wl_viewport_create(struct wl_resource *resource,
         return EINA_FALSE;
      }
 
-   struct wl_resource *comp_surface = e_comp_wl_client_surface_get(ec);
-   if (!comp_surface)
-     {
-        ERR("wrong resource");
-        return EINA_FALSE;
-     }
-
    surface = e_surface_from_resource(surface_resource);
    if (!surface)
      {
@@ -1733,7 +1726,7 @@ e_comp_wl_viewport_create(struct wl_resource *resource,
                                   viewport, _e_comp_wl_viewport_destroy);
 
    viewport->surface_destroy_listener.notify = _e_comp_wl_viewport_cb_surface_destroy;
-   wl_resource_add_destroy_listener(comp_surface, &viewport->surface_destroy_listener);
+   e_surface_destroy_listener_add(viewport->surface, &viewport->surface_destroy_listener);
 
    PIN("create viewport");