core: Don't merge floating selection as filter

Floating selections are added to the same stack as
non-destructive filters. While the GUI prevents merging
filters when there is a floating selection, 
gimp_drawable_merge_filters () did not explicitly prevent
this. This patch replaces the while loop to merge filters with
a for loop, and explicitly checks if the item in the stack is a
drawable filter (and not a temporary one).
This commit is contained in:
Alx Sa 2025-05-31 12:38:47 +00:00
parent 2baab5aa74
commit ae02db90a3

View file

@ -328,12 +328,20 @@ gimp_drawable_merge_filters (GimpDrawable *drawable)
g_clear_object (&buffer); g_clear_object (&buffer);
} }
while ((list = GIMP_LIST (drawable->private->filter_stack)->queue->tail)) for (list = GIMP_LIST (drawable->private->filter_stack)->queue->tail;
list;
list = list->prev)
{ {
gimp_image_undo_push_filter_remove (gimp_item_get_image (GIMP_ITEM (drawable)), if (GIMP_IS_DRAWABLE_FILTER (list->data) &&
_("Merge filter"), drawable, list->data); ! gimp_drawable_filter_get_temporary (list->data))
gimp_drawable_remove_filter (drawable, GIMP_FILTER (list->data)); {
gimp_image_undo_push_filter_remove (gimp_item_get_image (GIMP_ITEM (drawable)),
_("Merge filter"),
drawable, list->data);
gimp_drawable_remove_filter (drawable,
GIMP_FILTER (list->data));
}
} }
} }