From 75e665f0edda6d007666b50db82b9c8090f6bb7b Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 25 Feb 2026 15:44:29 +0100 Subject: [PATCH] Issue #15824: better detect the first filter. Ah my previous commit was working fine with a selection in the "Use the selection as input" case, but was still hanging when "Use the entire layer as input" was chosen. The detection of whether we were the first filter was not working fine when adding a new filter. Now this should work in all cases. I don't revert the previous commit, because I think it's fine anyway. When we have a selection, unconditionally adding a cropping-before node on the selection boundaries seems logical to me. Hopefully it doesn't bring back any of the cropping issues we had on filters, but so far I could not reproduce any. --- app/core/gimpdrawablefilter.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/core/gimpdrawablefilter.c b/app/core/gimpdrawablefilter.c index 4aa849e614..f9b084a95a 100644 --- a/app/core/gimpdrawablefilter.c +++ b/app/core/gimpdrawablefilter.c @@ -1429,8 +1429,12 @@ gimp_drawable_filter_sync_region (GimpDrawableFilter *filter) filters = gimp_drawable_get_filters (filter->drawable); /* The first test is because the filter might not be added yet. */ - if (GIMP_LIST (filters)->queue->tail != NULL && - filter == GIMP_LIST (filters)->queue->tail->data) + if (GIMP_LIST (filters)->queue->tail == NULL) + { + first_filter = TRUE; + } + else if (GIMP_LIST (filters)->queue->tail != NULL && + filter == GIMP_LIST (filters)->queue->tail->data) { GimpDrawableFilter *next_filter = NULL;