widgets: Prevent filter container duplication

Resolves #14206
If the user clicks the Fx icon in the DrawableTreeView
repeatedly (and quickly enough), the "closed" signal
function that cleans up the Filter popover does not
run before the next creation code is started. This can
results in the previous view being left in editor->vbox,
leading to duplication.
This patch checks if the editor and view already exist when
the popover opens, and if so, it runs the clean-up code first.
This commit is contained in:
Alx Sa 2025-06-08 01:42:24 +00:00
parent 9464e571ed
commit 6e58d05a56

View file

@ -143,6 +143,10 @@ _gimp_drawable_tree_view_filter_editor_show (GimpDrawableTreeView *view,
gint n_editable;
gboolean visible = FALSE;
/* Prevents "duplicate" filter views if you click the popover too fast */
if (editor && editor->view)
_gimp_drawable_tree_view_filter_editor_hide (view);
if (! editor)
{
GtkWidget *vbox;
@ -229,7 +233,7 @@ _gimp_drawable_tree_view_filter_editor_show (GimpDrawableTreeView *view,
G_CALLBACK (gimp_drawable_filters_editor_edit_clicked),
view);
/* "raide" button */
/* "raise" button */
editor->raise_button =
gtk_button_new_from_icon_name (GIMP_ICON_GO_UP,
GTK_ICON_SIZE_SMALL_TOOLBAR);