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 | |
parent | cmd_bind_or_unbind_switch: fix copy/paste typo error message (diff) | |
download | sway-c9060bcc12d01972bc3eadce5b3e626fe4fbf986.tar.gz sway-c9060bcc12d01972bc3eadce5b3e626fe4fbf986.tar.zst sway-c9060bcc12d01972bc3eadce5b3e626fe4fbf986.zip |
layer-shell: replace close() with destroy()
Update for the wlroots breaking change in [1].
[1]: https://github.com/swaywm/wlroots/pull/3108
-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, | |||
162 | } else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM)) { | 162 | } else if ((state->anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM)) { |
163 | box.y -= state->margin.bottom; | 163 | box.y -= state->margin.bottom; |
164 | } | 164 | } |
165 | if (box.width < 0 || box.height < 0) { | 165 | if (!sway_assert(box.width >= 0 && box.height >= 0, |
166 | // TODO: Bubble up a protocol error? | 166 | "Expected layer surface to have positive size")) { |
167 | wlr_layer_surface_v1_close(layer); | ||
168 | continue; | 167 | continue; |
169 | } | 168 | } |
170 | // Apply | 169 | // Apply |
@@ -287,7 +286,7 @@ static void handle_output_destroy(struct wl_listener *listener, void *data) { | |||
287 | } | 286 | } |
288 | 287 | ||
289 | sway_layer->layer_surface->output = NULL; | 288 | sway_layer->layer_surface->output = NULL; |
290 | wlr_layer_surface_v1_close(sway_layer->layer_surface); | 289 | wlr_layer_surface_v1_destroy(sway_layer->layer_surface); |
291 | } | 290 | } |
292 | 291 | ||
293 | static void handle_surface_commit(struct wl_listener *listener, void *data) { | 292 | 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) { | |||
623 | sway_log(SWAY_ERROR, | 622 | sway_log(SWAY_ERROR, |
624 | "no output to auto-assign layer surface '%s' to", | 623 | "no output to auto-assign layer surface '%s' to", |
625 | layer_surface->namespace); | 624 | layer_surface->namespace); |
626 | wlr_layer_surface_v1_close(layer_surface); | 625 | wlr_layer_surface_v1_destroy(layer_surface); |
627 | return; | 626 | return; |
628 | } | 627 | } |
629 | output = root->outputs->items[0]; | 628 | output = root->outputs->items[0]; |