From 5f561bfbca950c5a86694d6b65f8679e71666aa6 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Tue, 30 Jan 2024 19:49:23 +0000 Subject: [PATCH] tools: Don't make nop effects non-destructive If you run the GEGL Operation tool without choosing a filter, it leaves a "gegl:nop" layer effect behind. This is not useful, so we check and set such filters as destructive to get rid of when applying an effect. --- app/tools/gimpfiltertool.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c index 070f62f90a..cf1377c40b 100644 --- a/app/tools/gimpfiltertool.c +++ b/app/tools/gimpfiltertool.c @@ -471,6 +471,7 @@ gimp_filter_tool_control (GimpTool *tool, GimpFilterTool *filter_tool = GIMP_FILTER_TOOL (tool); GimpDrawable *drawable = NULL; gboolean non_destructive = TRUE; + gchar *operation_name = NULL; switch (action) { @@ -491,6 +492,18 @@ gimp_filter_tool_control (GimpTool *tool, if (! GIMP_IS_LAYER (drawable)) non_destructive = FALSE; + if (filter_tool->operation) + { + gegl_node_get (filter_tool->operation, + "operation", &operation_name, + NULL); + + if (! g_strcmp0 (operation_name, "gegl:nop")) + non_destructive = FALSE; + + g_free (operation_name); + } + gimp_filter_tool_commit (filter_tool, non_destructive); break; }