diff options
author | Simon Ser <contact@emersion.fr> | 2021-08-14 20:29:59 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-08-14 20:29:59 +0200 |
commit | c9060bcc12d01972bc3eadce5b3e626fe4fbf986 (patch) | |
tree | e1f281dba67814c18f2357d6232b1ab05c9163e8 /sway | |
parent | b17cf58a4dfcb1fbcbc039bf3032119764fd82b4 (diff) |
layer-shell: replace close() with destroy()
Update for the wlroots breaking change in [1].
[1]: https://github.com/swaywm/wlroots/pull/3108
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/layer_shell.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 8a41e705..47bb07bd 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -162,9 +162,8 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list, } else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM)) { box.y -= state->margin.bottom; } - if (box.width < 0 || box.height < 0) { - // TODO: Bubble up a protocol error? - wlr_layer_surface_v1_close(layer); + if (!sway_assert(box.width >= 0 && box.height >= 0, + "Expected layer surface to have positive size")) { continue; } // Apply @@ -287,7 +286,7 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) { } sway_layer->layer_surface->output = NULL; - wlr_layer_surface_v1_close(sway_layer->layer_surface); + wlr_layer_surface_v1_destroy(sway_layer->layer_surface); } static void handle_surface_commit(struct wl_listener *listener, void *data) { @@ -623,7 +622,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { sway_log(SWAY_ERROR, "no output to auto-assign layer surface '%s' to", layer_surface->namespace); - wlr_layer_surface_v1_close(layer_surface); + wlr_layer_surface_v1_destroy(layer_surface); return; } output = root->outputs->items[0]; |