From 99ab780d9fca6b43828da98e1009800539ec50d6 Mon Sep 17 00:00:00 2001 From: Ell Date: Fri, 12 May 2017 15:34:28 -0400 Subject: [PATCH] app: update layer backdrop only after removing from stack When a layer is removed from a layer stack, and its backdrop needs invalidating, emit the UPDATE signals for the backdrop only after the layer has been removed from the container. --- app/core/gimplayerstack.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/app/core/gimplayerstack.c b/app/core/gimplayerstack.c index e45138de42..9f5d1f45fe 100644 --- a/app/core/gimplayerstack.c +++ b/app/core/gimplayerstack.c @@ -112,10 +112,19 @@ gimp_layer_stack_remove (GimpContainer *container, GimpObject *object) { GimpLayerStack *stack = GIMP_LAYER_STACK (container); + gboolean update_backdrop; + gint index; - gimp_layer_stack_update_backdrop (stack, GIMP_LAYER (object), FALSE, FALSE); + update_backdrop = gimp_item_get_visible (GIMP_ITEM (object)) && + gimp_layer_get_excludes_backdrop (GIMP_LAYER (object)); + + if (update_backdrop) + index = gimp_container_get_child_index (container, object); GIMP_CONTAINER_CLASS (parent_class)->remove (container, object); + + if (update_backdrop) + gimp_layer_stack_update_range (stack, index, -1); } static void @@ -124,18 +133,18 @@ gimp_layer_stack_reorder (GimpContainer *container, gint new_index) { GimpLayerStack *stack = GIMP_LAYER_STACK (container); - gboolean excludes_backdrop; + gboolean update_backdrop; gint index; - excludes_backdrop = gimp_item_get_visible (GIMP_ITEM (object)) && - gimp_layer_get_excludes_backdrop (GIMP_LAYER (object)); + update_backdrop = gimp_item_get_visible (GIMP_ITEM (object)) && + gimp_layer_get_excludes_backdrop (GIMP_LAYER (object)); - if (excludes_backdrop) + if (update_backdrop) index = gimp_container_get_child_index (container, object); GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object, new_index); - if (excludes_backdrop) + if (update_backdrop) gimp_layer_stack_update_range (stack, index, new_index); }