diff options
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index bc917c6f3..bf3b70d43 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -660,9 +660,16 @@ SPDesktop::change_document (SPDocument *theDocument) void SPDesktop::set_event_context2(const std::string& toolName) { Inkscape::UI::Tools::ToolBase* old_tool = event_context; + if (old_tool) { - old_tool->finish(); - delete old_tool; + if (toolName.compare(old_tool->pref_observer->observed_path) != 0) { + //g_message("Old tool: %s", old_tool->pref_observer->observed_path.c_str()); + //g_message("New tool: %s", toolName.c_str()); + old_tool->finish(); + delete old_tool; + } else { + return; + } } Inkscape::UI::Tools::ToolBase* new_tool = ToolFactory::instance().createObject(toolName); |
