diff options
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r-- | sway/desktop/layer_shell.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index a5cd79ba..bf76b075 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c | |||
@@ -81,7 +81,6 @@ 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); | ||
85 | struct wlr_layer_surface_state *state = &layer->current; | 84 | struct wlr_layer_surface_state *state = &layer->current; |
86 | if (exclusive != (state->exclusive_zone > 0)) { | 85 | if (exclusive != (state->exclusive_zone > 0)) { |
87 | continue; | 86 | continue; |
@@ -167,10 +166,11 @@ void arrange_layers(struct sway_output *output) { | |||
167 | &usable_area, true); | 166 | &usable_area, true); |
168 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], | 167 | arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], |
169 | &usable_area, true); | 168 | &usable_area, true); |
170 | memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); | ||
171 | 169 | ||
172 | if (memcmp(&usable_area, &output->usable_area, | 170 | if (memcmp(&usable_area, &output->usable_area, |
173 | sizeof(struct wlr_box)) != 0) { | 171 | sizeof(struct wlr_box)) != 0) { |
172 | wlr_log(L_DEBUG, "Usable area changed, rearranging output"); | ||
173 | memcpy(&output->usable_area, &usable_area, sizeof(struct wlr_box)); | ||
174 | arrange_windows(output->swayc, -1, -1); | 174 | arrange_windows(output->swayc, -1, -1); |
175 | } | 175 | } |
176 | 176 | ||
@@ -204,8 +204,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { | |||
204 | if (wlr_output != NULL) { | 204 | if (wlr_output != NULL) { |
205 | struct sway_output *output = wlr_output->data; | 205 | struct sway_output *output = wlr_output->data; |
206 | struct wlr_box old_geo = layer->geo; | 206 | struct wlr_box old_geo = layer->geo; |
207 | arrange_layers(output); | ||
207 | if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) { | 208 | if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) { |
208 | arrange_layers(output); | ||
209 | // TODO DAMAGE apply whole surface from previous and new geos | 209 | // TODO DAMAGE apply whole surface from previous and new geos |
210 | } else { | 210 | } else { |
211 | // TODO DAMAGE from surface damage | 211 | // TODO DAMAGE from surface damage |
@@ -236,7 +236,6 @@ static void handle_destroy(struct wl_listener *listener, void *data) { | |||
236 | struct sway_output *output = sway_layer->layer_surface->output->data; | 236 | struct sway_output *output = sway_layer->layer_surface->output->data; |
237 | free(sway_layer); | 237 | free(sway_layer); |
238 | arrange_layers(output); | 238 | arrange_layers(output); |
239 | arrange_windows(output->swayc, -1, -1); | ||
240 | } | 239 | } |
241 | 240 | ||
242 | static void handle_map(struct wl_listener *listener, void *data) { | 241 | static void handle_map(struct wl_listener *listener, void *data) { |