e_compositor: Move wl_surface of e_pixmap assignment 16/316316/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 13 Aug 2024 22:59:20 +0000 (07:59 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 19 Aug 2024 08:09:01 +0000 (17:09 +0900)
This is to improve readability by moving assignment to relevant
implementation.

Change-Id: Ief2d3be566bc1c162c44d8039baa219aea15c414

src/bin/core/e_pixmap.c
src/bin/server/e_compositor.c

index f2e59e2a8e103eff389ede57426a6febb376ecd6..48f4cc0361c179d1f57f28957fcdd8e9e48e4042 100644 (file)
@@ -245,13 +245,20 @@ _e_pixmap_cb_surface_resource_destroy(struct wl_listener *listener, void *data)
 static void
 _e_pixmap_id_setup(E_Pixmap *cp, uintptr_t id)
 {
+   struct wl_resource *surface_resource;
+
    cp->win = id;
    eina_hash_add(pixmaps[cp->type], &id, cp);
 
    if (cp->type == E_PIXMAP_TYPE_WL)
      {
+        surface_resource = (struct wl_resource *)id;
+
+        if (cp->cdata)
+             cp->cdata->wl_surface = surface_resource;
+
         cp->surface_resource_destroy.notify = _e_pixmap_cb_surface_resource_destroy;
-        wl_resource_add_destroy_listener((struct wl_resource *)id, &cp->surface_resource_destroy);
+        wl_resource_add_destroy_listener(surface_resource, &cp->surface_resource_destroy);
      }
    else
      {
index 5a4053d6e1d5e5597fac08e820897f9f44d546fc..7d55e0ea36b00327678fc418a6f37baae04e2412 100644 (file)
@@ -733,10 +733,6 @@ _e_compositor_cb_new_surface(struct wl_listener *listener, void *data)
         return;
      }
 
-   E_Comp_Wl_Client_Data *cdata = e_pixmap_cdata_get(ep);
-   if (cdata)
-     cdata->wl_surface = surface_resource;
-
    DBG("\tUsing Pixmap: %p", ep);
 
    wl_client_get_credentials(wl_resource_get_client(surface_resource), &pid, NULL, NULL);