shell_getsurf(struct wl_client * client,struct wl_resource * res,uint32_t id,struct wl_resource * surf_res)1 static void shell_getsurf(struct wl_client* client,
2 struct wl_resource* res, uint32_t id, struct wl_resource* surf_res)
3 {
4 trace(TRACE_SHELL, "get shell surface");
5 struct comp_surf* surf = wl_resource_get_user_data(surf_res);
6
7 struct wl_resource* ssurf = wl_resource_create(client,
8 &wl_shell_surface_interface, wl_resource_get_version(surf_res), id);
9
10 if (!ssurf){
11 wl_resource_post_no_memory(surf_res);
12 return;
13 }
14
15 wl_resource_set_implementation(ssurf, &ssurf_if, surf, NULL);
16 }
17