From 17b094ecc4a822de6d7524acc9ec20aeb3e20ea1 Mon Sep 17 00:00:00 2001 From: Jehan Date: Tue, 27 Aug 2024 19:09:48 +0200 Subject: [PATCH] Issue #9600: CRITICAL when anchoring a floating selection to the image's selection. --- app/core/gimplayer-floating-selection.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/core/gimplayer-floating-selection.c b/app/core/gimplayer-floating-selection.c index 14b81aa0e6..bf625265da 100644 --- a/app/core/gimplayer-floating-selection.c +++ b/app/core/gimplayer-floating-selection.c @@ -34,6 +34,7 @@ #include "gimplayer.h" #include "gimplayer-floating-selection.h" #include "gimplayermask.h" +#include "gimpselection.h" #include "gimp-intl.h" @@ -217,7 +218,7 @@ floating_sel_activate_drawable (GimpLayer *layer) { GimpImage *image; GimpDrawable *drawable; - GList *selected_drawables; + GList *selected_drawables = NULL; g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); @@ -234,12 +235,12 @@ floating_sel_activate_drawable (GimpLayer *layer) selected_drawables = g_list_prepend (NULL, gimp_layer_mask_get_layer (mask)); gimp_image_set_selected_layers (image, selected_drawables); } - else if (GIMP_IS_CHANNEL (drawable)) + else if (GIMP_IS_CHANNEL (drawable) && ! GIMP_IS_SELECTION (drawable)) { selected_drawables = g_list_prepend (NULL, drawable); gimp_image_set_selected_channels (image, selected_drawables); } - else + else if (! GIMP_IS_SELECTION (drawable)) { selected_drawables = g_list_prepend (NULL, drawable); gimp_image_set_selected_layers (image, selected_drawables);