diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2014-01-14 22:02:41 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2014-01-14 22:02:41 +0000 |
| commit | 35649d3846d690ad444db4645156995baba945ff (patch) | |
| tree | bec4bed7dea1f6cf08831b4f12a6cdbb8c8694c9 /src | |
| parent | multi-path-manipulator: strip dead code (diff) | |
| download | inkscape-35649d3846d690ad444db4645156995baba945ff.tar.gz inkscape-35649d3846d690ad444db4645156995baba945ff.zip | |
Fix for Bug #1268778 (Move cursor disappears after clicking on Select Tool (F1) twice).
Fixed bugs:
- https://launchpad.net/bugs/1268778
(bzr r12931)
Diffstat (limited to 'src')
| -rw-r--r-- | src/desktop.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index 195127ca1..bc917c6f3 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -657,19 +657,18 @@ SPDesktop::change_document (SPDocument *theDocument) /** * Replaces the currently active tool with a new one. */ -void SPDesktop::set_event_context2(const std::string& toolName) { - Inkscape::UI::Tools::ToolBase* new_tool = ToolFactory::instance().createObject(toolName); - new_tool->desktop = this; - new_tool->message_context = new Inkscape::MessageContext(this->messageStack()); - +void SPDesktop::set_event_context2(const std::string& toolName) +{ Inkscape::UI::Tools::ToolBase* old_tool = event_context; - event_context = new_tool; - - if (old_tool) { - old_tool->finish(); - delete old_tool; - } - + if (old_tool) { + old_tool->finish(); + delete old_tool; + } + + Inkscape::UI::Tools::ToolBase* new_tool = ToolFactory::instance().createObject(toolName); + new_tool->desktop = this; + new_tool->message_context = new Inkscape::MessageContext(this->messageStack()); + event_context = new_tool; new_tool->setup(); // Make sure no delayed snapping events are carried over after switching tools @@ -677,7 +676,7 @@ void SPDesktop::set_event_context2(const std::string& toolName) { // tool should take care of this by itself) sp_event_context_discard_delayed_snap_event(event_context); - _event_context_changed_signal.emit(this, event_context); + _event_context_changed_signal.emit(this, event_context); } /** |
