|
|
@ -78,17 +78,17 @@ static void destroy_frame_callback(struct wl_resource *resource) {
|
|
|
|
|
|
|
|
|
|
|
|
static void surface_frame(struct wl_client *client,
|
|
|
|
static void surface_frame(struct wl_client *client,
|
|
|
|
struct wl_resource *resource, uint32_t callback) {
|
|
|
|
struct wl_resource *resource, uint32_t callback) {
|
|
|
|
struct wlr_frame_callback *cb;
|
|
|
|
|
|
|
|
struct wlr_surface *surface = wl_resource_get_user_data(resource);
|
|
|
|
struct wlr_surface *surface = wl_resource_get_user_data(resource);
|
|
|
|
|
|
|
|
|
|
|
|
cb = malloc(sizeof(struct wlr_frame_callback));
|
|
|
|
struct wlr_frame_callback *cb =
|
|
|
|
|
|
|
|
calloc(1, sizeof(struct wlr_frame_callback));
|
|
|
|
if (cb == NULL) {
|
|
|
|
if (cb == NULL) {
|
|
|
|
wl_resource_post_no_memory(resource);
|
|
|
|
wl_resource_post_no_memory(resource);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cb->resource = wl_resource_create(client,
|
|
|
|
cb->resource = wl_resource_create(client, &wl_callback_interface, 1,
|
|
|
|
&wl_callback_interface, 1, callback);
|
|
|
|
callback);
|
|
|
|
if (cb->resource == NULL) {
|
|
|
|
if (cb->resource == NULL) {
|
|
|
|
free(cb);
|
|
|
|
free(cb);
|
|
|
|
wl_resource_post_no_memory(resource);
|
|
|
|
wl_resource_post_no_memory(resource);
|
|
|
@ -555,7 +555,11 @@ const struct wl_surface_interface surface_interface = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static struct wlr_surface_state *wlr_surface_state_create() {
|
|
|
|
static struct wlr_surface_state *wlr_surface_state_create() {
|
|
|
|
struct wlr_surface_state *state = calloc(1, sizeof(struct wlr_surface_state));
|
|
|
|
struct wlr_surface_state *state =
|
|
|
|
|
|
|
|
calloc(1, sizeof(struct wlr_surface_state));
|
|
|
|
|
|
|
|
if (state == NULL) {
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
state->scale = 1;
|
|
|
|
state->scale = 1;
|
|
|
|
state->transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
|
|
|
state->transform = WL_OUTPUT_TRANSFORM_NORMAL;
|
|
|
|
|
|
|
|
|
|
|
@ -619,8 +623,8 @@ static void destroy_surface(struct wl_resource *resource) {
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_surface *wlr_surface_create(struct wl_resource *res,
|
|
|
|
struct wlr_surface *wlr_surface_create(struct wl_resource *res,
|
|
|
|
struct wlr_renderer *renderer) {
|
|
|
|
struct wlr_renderer *renderer) {
|
|
|
|
struct wlr_surface *surface;
|
|
|
|
struct wlr_surface *surface = calloc(1, sizeof(struct wlr_surface));
|
|
|
|
if (!(surface = calloc(1, sizeof(struct wlr_surface)))) {
|
|
|
|
if (!surface) {
|
|
|
|
wl_resource_post_no_memory(res);
|
|
|
|
wl_resource_post_no_memory(res);
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|