aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 21:28:31 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-29 22:11:08 -0400
commitc91adbd188414c12f5c30d94790e3495532653a1 (patch)
treec17ca47872f1362bd958adbefe27326ec09bd23e /sway/desktop/layer_shell.c
parentDo some small cleanup (diff)
downloadsway-c91adbd188414c12f5c30d94790e3495532653a1.tar.gz
sway-c91adbd188414c12f5c30d94790e3495532653a1.tar.zst
sway-c91adbd188414c12f5c30d94790e3495532653a1.zip
Fix failure to rearrange output in some cases
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c7
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
242static void handle_map(struct wl_listener *listener, void *data) { 241static void handle_map(struct wl_listener *listener, void *data) {