mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-14 06:59:43 -05:00
Add layer_surface.close
This commit is contained in:
parent
b73c4f48c1
commit
d1c0e6fe2c
5 changed files with 43 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue