diff --git a/app/actions/tools-commands.c b/app/actions/tools-commands.c index e8204ebbb1..7a4d19d081 100644 --- a/app/actions/tools-commands.c +++ b/app/actions/tools-commands.c @@ -74,7 +74,7 @@ tools_swap_cmd_callback (GimpAction *action, return_if_no_gimp (gimp, data); - tool_manager_swap_tools (gimp); + tool_manager_swap_tools (gimp, FALSE); } void diff --git a/app/tests/test-ui.c b/app/tests/test-ui.c index ff66ca2047..5a0d67f633 100644 --- a/app/tests/test-ui.c +++ b/app/tests/test-ui.c @@ -484,7 +484,7 @@ swap_tools (gconstpointer data) gimp_context_set_tool (user_context, second_tool_info); g_assert (gimp_context_get_tool (user_context) == second_tool_info); - tool_manager_swap_tools (gimp); + tool_manager_swap_tools (gimp, FALSE); g_assert (gimp_context_get_tool (user_context) == first_tool_info); } } diff --git a/app/tools/gimpfiltertool.c b/app/tools/gimpfiltertool.c index 9b779f613f..c4bb5f81b3 100644 --- a/app/tools/gimpfiltertool.c +++ b/app/tools/gimpfiltertool.c @@ -1234,7 +1234,7 @@ 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); + tool_manager_swap_tools (tool->tool_info->gimp, TRUE); } static void diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c index 04327de3d2..dfdbf8a118 100644 --- a/app/tools/tool_manager.c +++ b/app/tools/tool_manager.c @@ -56,6 +56,7 @@ struct _GimpToolManager GSList *tool_stack; GList *history; + gboolean block_initialization; GimpToolGroup *active_tool_group; @@ -121,8 +122,9 @@ tool_manager_init (Gimp *gimp) tool_manager = g_slice_new0 (GimpToolManager); - tool_manager->gimp = gimp; - tool_manager->history = NULL; + tool_manager->gimp = gimp; + tool_manager->history = NULL; + tool_manager->block_initialization = FALSE; g_object_set_qdata (G_OBJECT (gimp), tool_manager_quark, tool_manager); @@ -282,7 +284,8 @@ tool_manager_pop_tool (Gimp *gimp) } void -tool_manager_swap_tools (Gimp *gimp) +tool_manager_swap_tools (Gimp *gimp, + gboolean block_initialization) { GimpToolManager *tool_manager; @@ -291,8 +294,12 @@ tool_manager_swap_tools (Gimp *gimp) tool_manager = tool_manager_get (gimp); if (g_list_length (tool_manager->history) > 1) - gimp_context_set_tool (tool_manager->gimp->user_context, - g_list_nth_data (tool_manager->history, 1)); + { + tool_manager->block_initialization = block_initialization; + gimp_context_set_tool (tool_manager->gimp->user_context, + g_list_nth_data (tool_manager->history, 1)); + tool_manager->block_initialization = FALSE; + } } gboolean @@ -816,8 +823,9 @@ tool_manager_tool_changed (GimpContext *user_context, tool_manager_select_tool (tool_manager, new_tool); /* Auto-activate any transform or GEGL operation tools */ - if (GIMP_IS_TRANSFORM_GRID_TOOL (new_tool) || - GIMP_IS_GEGL_TOOL (new_tool)) + if (! tool_manager->block_initialization && + (GIMP_IS_TRANSFORM_GRID_TOOL (new_tool) || + GIMP_IS_GEGL_TOOL (new_tool))) { GimpDisplay *new_display; diff --git a/app/tools/tool_manager.h b/app/tools/tool_manager.h index 95ff1a1451..9279b45673 100644 --- a/app/tools/tool_manager.h +++ b/app/tools/tool_manager.h @@ -27,7 +27,8 @@ void tool_manager_push_tool (Gimp *gimp, GimpTool *tool); void tool_manager_pop_tool (Gimp *gimp); -void tool_manager_swap_tools (Gimp *gimp); +void tool_manager_swap_tools (Gimp *gimp, + gboolean block_initialization); gboolean tool_manager_initialize_active (Gimp *gimp, GimpDisplay *display);