Merge branch 'master' into feature/wlr-seat-touch

This commit is contained in:
Tony Crisci 2017-11-16 16:19:17 -05:00
commit 584ff1df4c
16 changed files with 196 additions and 93 deletions

View file

@ -713,7 +713,10 @@ static void data_device_start_drag(struct wl_client *client,
if (!seat_client_start_drag(seat_client, source, icon, origin, serial)) {
wl_resource_post_no_memory(device_resource);
} else {
return;
}
if (source) {
source->seat_client = seat_client;
}
}

View file

@ -105,7 +105,10 @@ void wlr_keyboard_init(struct wlr_keyboard *kb,
}
void wlr_keyboard_destroy(struct wlr_keyboard *kb) {
if (kb && kb->impl && kb->impl->destroy) {
if (kb == NULL) {
return;
}
if (kb->impl && kb->impl->destroy) {
kb->impl->destroy(kb);
} else {
wl_list_remove(&kb->events.key.listener_list);

View file

@ -29,8 +29,7 @@ static void wl_output_send_to_resource(struct wl_resource *resource) {
if (version >= WL_OUTPUT_MODE_SINCE_VERSION) {
struct wlr_output_mode *mode;
wl_list_for_each(mode, &output->modes, link) {
// TODO: mode->flags should just be preferred
uint32_t flags = mode->flags;
uint32_t flags = mode->flags & WL_OUTPUT_MODE_PREFERRED;
if (output->current_mode == mode) {
flags |= WL_OUTPUT_MODE_CURRENT;
}
@ -62,13 +61,17 @@ static void wlr_output_send_current_mode_to_resource(
}
if (output->current_mode != NULL) {
struct wlr_output_mode *mode = output->current_mode;
wl_output_send_mode(resource, mode->flags | WL_OUTPUT_MODE_CURRENT,
uint32_t flags = mode->flags & WL_OUTPUT_MODE_PREFERRED;
wl_output_send_mode(resource, flags | WL_OUTPUT_MODE_CURRENT,
mode->width, mode->height, mode->refresh);
} else {
// Output has no mode, send the current width/height
wl_output_send_mode(resource, WL_OUTPUT_MODE_CURRENT, output->width,
output->height, 0);
}
if (version >= WL_OUTPUT_DONE_SINCE_VERSION) {
wl_output_send_done(resource);
}
}
static void wl_output_destroy(struct wl_resource *resource) {
@ -163,6 +166,9 @@ bool wlr_output_set_mode(struct wlr_output *output,
void wlr_output_update_size(struct wlr_output *output, int32_t width,
int32_t height) {
if (output->width == width && output->height == height) {
return;
}
output->width = width;
output->height = height;
wlr_output_update_matrix(output);

View file

@ -85,6 +85,7 @@ static void screenshooter_shoot(struct wl_client *client,
struct wlr_screenshot *screenshot =
calloc(1, sizeof(struct wlr_screenshot));
if (!screenshot) {
free(pixels);
wl_resource_post_no_memory(screenshooter_resource);
return;
}
@ -96,6 +97,7 @@ static void screenshooter_shoot(struct wl_client *client,
wl_resource_get_version(screenshooter_resource), id);
if (screenshot->resource == NULL) {
free(screenshot);
free(pixels);
wl_resource_post_no_memory(screenshooter_resource);
return;
}
@ -109,6 +111,7 @@ static void screenshooter_shoot(struct wl_client *client,
if (!state) {
wl_resource_destroy(screenshot->resource);
free(screenshot);
free(pixels);
wl_resource_post_no_memory(screenshooter_resource);
return;
}

View file

@ -347,7 +347,7 @@ static void shell_surface_protocol_set_popup(struct wl_client *client,
transient_state->flags = flags;
struct wlr_wl_shell_surface_popup_state *popup_state =
calloc(1, sizeof(struct wlr_wl_shell_surface_transient_state));
calloc(1, sizeof(struct wlr_wl_shell_surface_popup_state));
if (popup_state == NULL) {
free(transient_state);
wl_client_post_no_memory(client);