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();
}