From 07a6c75454320cc6d082dfdf31bbee27a255cc4b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 7 May 2020 09:20:06 +0200 Subject: [PATCH] output-layer: don't mark ordering as dirty if it didn't change --- types/wlr_output_layer.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/types/wlr_output_layer.c b/types/wlr_output_layer.c index 154974ae1..0aa19d9b1 100644 --- a/types/wlr_output_layer.c +++ b/types/wlr_output_layer.c @@ -85,6 +85,15 @@ void wlr_output_layer_place_above(struct wlr_output_layer *layer, wl_list_remove(&layer->pending.link); wl_list_insert(&sibling->pending.link, &layer->pending.link); + + if (layer->current.link.prev != &layer->output->layers) { + struct wlr_output_layer *prev = + wl_container_of(layer->current.link.prev, prev, current.link); + if (prev == sibling) { + return; + } + } + layer->pending.committed |= WLR_OUTPUT_LAYER_STATE_LINK; layer->output->pending.committed |= WLR_OUTPUT_STATE_LAYERS; } @@ -95,6 +104,15 @@ void wlr_output_layer_place_below(struct wlr_output_layer *layer, wl_list_remove(&layer->pending.link); wl_list_insert(sibling->pending.link.prev, &layer->pending.link); + + if (layer->current.link.next != &layer->output->layers) { + struct wlr_output_layer *next = + wl_container_of(layer->current.link.next, next, current.link); + if (next == sibling) { + return; + } + } + layer->pending.committed |= WLR_OUTPUT_LAYER_STATE_LINK; layer->output->pending.committed |= WLR_OUTPUT_STATE_LAYERS; }