mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-16 06:59:44 -05:00
parent
5ca88af557
commit
5cc7342606
13 changed files with 109 additions and 13 deletions
|
|
@ -200,7 +200,11 @@ static void destroy_surface(struct wl_resource *resource) {
|
|||
|
||||
struct wlr_surface *wlr_surface_create(struct wl_resource *res,
|
||||
struct wlr_renderer *renderer) {
|
||||
struct wlr_surface *surface = calloc(1, sizeof(struct wlr_surface));
|
||||
struct wlr_surface *surface;
|
||||
if (!(surface = calloc(1, sizeof(struct wlr_surface)))) {
|
||||
wl_resource_post_no_memory(res);
|
||||
return NULL;
|
||||
}
|
||||
surface->renderer = renderer;
|
||||
surface->texture = wlr_render_texture_init(renderer);
|
||||
surface->resource = res;
|
||||
|
|
|
|||
|
|
@ -141,8 +141,10 @@ static void xdg_shell_get_xdg_surface(struct wl_client *client,
|
|||
struct wl_resource *_xdg_shell, uint32_t id,
|
||||
struct wl_resource *_surface) {
|
||||
struct wlr_xdg_shell_v6 *xdg_shell = wl_resource_get_user_data(_xdg_shell);
|
||||
struct wlr_xdg_surface_v6 *surface =
|
||||
calloc(1, sizeof(struct wlr_xdg_surface_v6));
|
||||
struct wlr_xdg_surface_v6 *surface;
|
||||
if (!(surface = calloc(1, sizeof(struct wlr_xdg_surface_v6)))) {
|
||||
return;
|
||||
}
|
||||
surface->surface = _surface;
|
||||
surface->resource = wl_resource_create(client,
|
||||
&zxdg_surface_v6_interface, wl_resource_get_version(_xdg_shell), id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue