e_compositor: Remove handling internal wl_surface 14/316314/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 13 Aug 2024 01:25:51 +0000 (10:25 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 19 Aug 2024 08:09:01 +0000 (17:09 +0900)
We've been no longer using wl_surface internally.

Change-Id: Ic5e8a64ce26523eae2e2be04eed8badaecf6f6e2

src/bin/server/e_compositor.c

index 21376898944522b9ec56756117b280ca3cde28fb..dd69bd2b53a337ce11a6ba22fdb5241906ad25b4 100644 (file)
@@ -718,60 +718,51 @@ _e_compositor_cb_new_surface(struct wl_listener *listener, void *data)
    E_Pixmap *ep;
    struct wl_resource *surface_resource;
    pid_t pid;
-   int internal = 0;
 
    DBG("New ds_surface %p", ds_surface);
 
    TRACE_DS_BEGIN(COMP_WL:NEW SURFACE CB);
 
    surface_resource = ds_surface_get_wl_resource(ds_surface);
-   wl_client_get_credentials(wl_resource_get_client(surface_resource), &pid, NULL, NULL);
-   if (pid == getpid())
-     {
-        internal = 1;
-        ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, (uintptr_t)wl_resource_get_id(surface_resource));
-     }
 
-   if (!ec)
+   /* try to create new pixmap */
+   if (!(ep = e_pixmap_new(E_PIXMAP_TYPE_WL, surface_resource)))
      {
-        /* try to create new pixmap */
-        if (!(ep = e_pixmap_new(E_PIXMAP_TYPE_WL, surface_resource)))
-          {
-             ERR("Could not create new pixmap");
-             TRACE_DS_END();
-             return;
-          }
+        ERR("Could not create new pixmap");
+        TRACE_DS_END();
+        return;
+     }
 
-        E_Comp_Wl_Client_Data *cdata = e_pixmap_cdata_get(ep);
-        if (cdata)
-          cdata->wl_surface = surface_resource;
+   E_Comp_Wl_Client_Data *cdata = e_pixmap_cdata_get(ep);
+   if (cdata)
+     cdata->wl_surface = surface_resource;
 
-        DBG("\tUsing Pixmap: %p", ep);
+   DBG("\tUsing Pixmap: %p", ep);
 
-        if (!(ec = _e_comp_wl_client_usable_get(pid, ep)))
-          {
-             ec = e_client_new(ep, 0, internal);
-          }
-     }
-   if (ec)
+   wl_client_get_credentials(wl_resource_get_client(surface_resource), &pid, NULL, NULL);
+   if (!(ec = _e_comp_wl_client_usable_get(pid, ep)))
      {
-        if (!ec->netwm.pid)
-          ec->netwm.pid = pid;
-        if (ec->new_client)
-          e_comp->new_clients--;
-        ec->new_client = 0;
-        if ((!ec->client.w) && (ec->client.h))
-          ec->client.w = ec->client.h = 1;
-
-        e_comp_wl_client_surface_set(ec, surface_resource);
-        ec->icccm.accepts_focus = 1;
-        wl_list_init(&ec->comp_data->pointer_constraints);
-
-        _e_surface_ds_surface_set(e_surface_from_ec(ec), ds_surface);
+        ec = e_client_new(ep, 0, 0);
+        if (!ec)
+          goto end;
      }
 
-   DBG("\tUsing Client: %p", ec);
+   if (!ec->netwm.pid)
+     ec->netwm.pid = pid;
+   if (ec->new_client)
+     e_comp->new_clients--;
+   ec->new_client = 0;
+   if ((!ec->client.w) && (ec->client.h))
+     ec->client.w = ec->client.h = 1;
 
+   e_comp_wl_client_surface_set(ec, surface_resource);
+   ec->icccm.accepts_focus = 1;
+   wl_list_init(&ec->comp_data->pointer_constraints);
+
+   _e_surface_ds_surface_set(e_surface_from_ec(ec), ds_surface);
+
+   DBG("\tUsing Client: %p", ec);
+end:
    TRACE_DS_END();
 }