aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sway/layers.h1
-rw-r--r--sway/desktop/layer_shell.c12
2 files changed, 12 insertions, 1 deletions
diff --git a/include/sway/layers.h b/include/sway/layers.h
index 255af8a0..025776f8 100644
--- a/include/sway/layers.h
+++ b/include/sway/layers.h
@@ -22,6 +22,7 @@ struct sway_layer_surface {
22 struct wl_listener new_popup; 22 struct wl_listener new_popup;
23 23
24 struct wlr_box geo; 24 struct wlr_box geo;
25 enum zwlr_layer_shell_v1_layer layer;
25}; 26};
26 27
27struct sway_layer_popup { 28struct sway_layer_popup {
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 5f2b74cd..9289bb4a 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -277,7 +277,17 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
277 struct sway_output *output = wlr_output->data; 277 struct sway_output *output = wlr_output->data;
278 struct wlr_box old_geo = layer->geo; 278 struct wlr_box old_geo = layer->geo;
279 arrange_layers(output); 279 arrange_layers(output);
280 if (memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0) { 280
281 bool geo_changed =
282 memcmp(&old_geo, &layer->geo, sizeof(struct wlr_box)) != 0;
283 bool layer_changed = layer->layer != layer_surface->current.layer;
284 if (layer_changed) {
285 wl_list_remove(&layer->link);
286 wl_list_insert(&output->layers[layer_surface->current.layer],
287 &layer->link);
288 layer->layer = layer_surface->current.layer;
289 }
290 if (geo_changed || layer_changed) {
281 output_damage_surface(output, old_geo.x, old_geo.y, 291 output_damage_surface(output, old_geo.x, old_geo.y,
282 layer_surface->surface, true); 292 layer_surface->surface, true);
283 output_damage_surface(output, layer->geo.x, layer->geo.y, 293 output_damage_surface(output, layer->geo.x, layer->geo.y,