Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
Fix a whoopsie
Browse files Browse the repository at this point in the history
  • Loading branch information
any1 committed Nov 28, 2021
1 parent e9939fc commit 9bed12b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions types/wlr_zext_screencopy_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,14 @@ static void surface_commit(struct wl_client *client,
surface->current_buffer.resource = surface->staged_buffer.resource;
surface->staged_buffer.resource = NULL;

wl_list_remove(&surface->staged_buffer.destroy.link);
wl_resource_add_destroy_listener(surface->current_buffer.resource,
&surface->current_buffer.destroy);
surface->current_buffer.destroy.notify =
surface_handle_committed_buffer_destroy;
if (surface->current_buffer.resource) {
wl_list_remove(&surface->staged_buffer.destroy.link);
wl_resource_add_destroy_listener(
surface->current_buffer.resource,
&surface->current_buffer.destroy);
surface->current_buffer.destroy.notify =
surface_handle_committed_buffer_destroy;
}

pixman_region32_copy(&surface->current_buffer.damage,
&surface->staged_buffer.damage);
Expand All @@ -230,11 +233,14 @@ static void surface_commit(struct wl_client *client,
surface->staged_cursor_buffer.resource;
surface->staged_cursor_buffer.resource = NULL;

wl_list_remove(&surface->staged_cursor_buffer.destroy.link);
wl_resource_add_destroy_listener(surface->current_cursor_buffer.resource,
&surface->current_cursor_buffer.destroy);
surface->current_cursor_buffer.destroy.notify =
surface_handle_committed_cursor_buffer_destroy;
if (surface->current_cursor_buffer.resource) {
wl_list_remove(&surface->staged_cursor_buffer.destroy.link);
wl_resource_add_destroy_listener(
surface->current_cursor_buffer.resource,
&surface->current_cursor_buffer.destroy);
surface->current_cursor_buffer.destroy.notify =
surface_handle_committed_cursor_buffer_destroy;
}

pixman_region32_copy(&surface->current_cursor_buffer.damage,
&surface->staged_cursor_buffer.damage);
Expand Down

0 comments on commit 9bed12b

Please sign in to comment.