Issue #9463: select back the previous tool when halting a layer effect.

This implies both when canceling or committing a filter.

Part of the fix is that we don't store filter tools as part of the tool
history, which means that when we swap back to the previous tool, the
filter tool info is dropped as though we never went through it. This
way, filter tools don't actually look as other tools (even though they
technically still are, since this is how we can implement canvas
interaction for some of the filters).
This commit is contained in:
Jehan 2025-08-06 19:34:05 +02:00
parent dddca29423
commit bfd414ead9
2 changed files with 13 additions and 0 deletions

View file

@ -1232,6 +1232,9 @@ gimp_filter_tool_halt (GimpFilterTool *filter_tool)
}
filter_tool->existing_filter = NULL;
if (tool_manager_get_active (tool->tool_info->gimp) == tool)
tool_manager_swap_tools (tool->tool_info->gimp);
}
static void

View file

@ -711,6 +711,16 @@ tool_manager_select_tool (GimpToolManager *tool_manager,
tool_manager->history = g_list_delete_link (tool_manager->history,
g_list_last (tool_manager->history));
}
if (g_list_length (tool_manager->history) > 1)
{
/* Never store filter tool in history (only as current tool). */
GList *prev_list = g_list_nth (tool_manager->history, 1);
GimpToolInfo *prev_tool = prev_list->data;
if (g_type_is_a (prev_tool->tool_type, GIMP_TYPE_FILTER_TOOL))
tool_manager->history = g_list_delete_link (tool_manager->history, prev_list);
}
}
g_set_object (&tool_manager->active_tool, tool);