Add layer_surface.close

This commit is contained in:
Drew DeVault 2018-03-24 18:00:01 -04:00
parent b73c4f48c1
commit d1c0e6fe2c
5 changed files with 43 additions and 4 deletions

View file

@ -244,6 +244,12 @@ void wlr_layer_surface_configure(struct wlr_layer_surface *surface,
wlr_layer_surface_schedule_configure(surface);
}
void wlr_layer_surface_close(struct wlr_layer_surface *surface) {
surface->closed = true;
layer_surface_unmap(surface);
zwlr_layer_surface_v1_send_closed(surface->resource);
}
static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface,
void *role_data) {
struct wlr_layer_surface *surface = role_data;
@ -255,6 +261,11 @@ static void handle_wlr_surface_committed(struct wlr_surface *wlr_surface,
return;
}
if (surface->closed) {
// Ignore commits after the compositor has closed it
return;
}
surface->current.anchor = surface->client_pending.anchor;
surface->current.exclusive_zone = surface->client_pending.exclusive_zone;
surface->current.margin = surface->client_pending.margin;