diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-29 18:24:29 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-29 22:11:08 -0400 |
commit | 5f5076baffa34a9e0d3e33c8fd5ce7c8e8bdeb2d (patch) | |
tree | 7957fbb5be0ccc074f97b52a719ab6ee943c2f8d | |
parent | Restart swaybar on config reload (diff) | |
download | sway-5f5076baffa34a9e0d3e33c8fd5ce7c8e8bdeb2d.tar.gz sway-5f5076baffa34a9e0d3e33c8fd5ce7c8e8bdeb2d.tar.zst sway-5f5076baffa34a9e0d3e33c8fd5ce7c8e8bdeb2d.zip |
Call arrange_windows on layer destroy
-rw-r--r-- | sway/desktop/layer_shell.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index 187c8664..d8ce0db1 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -81,6 +81,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list, | |||
81 | &full_area.width, &full_area.height); | 81 | &full_area.width, &full_area.height); |
82 | wl_list_for_each(sway_layer, list, link) { | 82 | wl_list_for_each(sway_layer, list, link) { |
83 | struct wlr_layer_surface *layer = sway_layer->layer_surface; | 83 | struct wlr_layer_surface *layer = sway_layer->layer_surface; |
84 | wlr_log(L_DEBUG, "arranging layer %p %s", sway_layer, layer->namespace); | ||
84 | struct wlr_layer_surface_state *state = &layer->current; | 85 | struct wlr_layer_surface_state *state = &layer->current; |
85 | if (exclusive != (state->exclusive_zone > 0)) { | 86 | if (exclusive != (state->exclusive_zone > 0)) { |
86 | continue; | 87 | continue; |
@@ -168,7 +169,10 @@ void arrange_layers(struct sway_output *output) { | |||
168 | &usable_area, true); | 169 | &usable_area, true); |
169 | memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); | 170 | memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); |
170 | 171 | ||
171 | arrange_windows(output->swayc, -1, -1); | 172 | if (memcmp(&usable_area, &output->usable_area, |
173 | sizeof(struct wlr_box)) != 0) { | ||
174 | arrange_windows(output->swayc, -1, -1); | ||
175 | } | ||
172 | 176 | ||
173 | // Arrange non-exlusive surfaces from top->bottom | 177 | // Arrange non-exlusive surfaces from top->bottom |
174 | usable_area.x = usable_area.y = 0; | 178 | usable_area.x = usable_area.y = 0; |
@@ -216,7 +220,8 @@ static void unmap(struct wlr_layer_surface *layer_surface) { | |||
216 | static void handle_destroy(struct wl_listener *listener, void *data) { | 220 | static void handle_destroy(struct wl_listener *listener, void *data) { |
217 | struct sway_layer_surface *sway_layer = wl_container_of( | 221 | struct sway_layer_surface *sway_layer = wl_container_of( |
218 | listener, sway_layer, destroy); | 222 | listener, sway_layer, destroy); |
219 | wlr_log(L_DEBUG, "layer surface removed"); | 223 | wlr_log(L_DEBUG, "Layer surface destroyed (%s)", |
224 | sway_layer->layer_surface->namespace); | ||
220 | if (sway_layer->layer_surface->mapped) { | 225 | if (sway_layer->layer_surface->mapped) { |
221 | unmap(sway_layer->layer_surface); | 226 | unmap(sway_layer->layer_surface); |
222 | } | 227 | } |
@@ -231,6 +236,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
231 | struct sway_output *output = sway_layer->layer_surface->output->data; | 236 | struct sway_output *output = sway_layer->layer_surface->output->data; |
232 | free(sway_layer); | 237 | free(sway_layer); |
233 | arrange_layers(output); | 238 | arrange_layers(output); |
239 | arrange_windows(output->swayc, -1, -1); | ||
234 | } | 240 | } |
235 | 241 | ||
236 | static void handle_map(struct wl_listener *listener, void *data) { | 242 | static void handle_map(struct wl_listener *listener, void *data) { |