diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 123293d7e450c21996cce510dfe6c6fbdf94e0b5..43e1d21709a294049355f3ce7cfb8322208910a7 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -1252,7 +1252,8 @@ sp_undo(SPDesktop *desktop, SPDocument *) { // No re/undo while dragging, too dangerous. if (desktop->getCanvas()->is_dragging()) return; - + // we force unselect to avoid knot problems + desktop->selection->clear(); if (!DocumentUndo::undo(desktop->getDocument())) { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to undo.")); } @@ -1263,7 +1264,8 @@ sp_redo(SPDesktop *desktop, SPDocument *) { // No re/undo while dragging, too dangerous. if (desktop->getCanvas()->is_dragging()) return; - + // we force unselect to avoid knot problems + desktop->selection->clear(); if (!DocumentUndo::redo(desktop->getDocument())) { desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to redo.")); } diff --git a/src/ui/dialog/undo-history.cpp b/src/ui/dialog/undo-history.cpp index a2e3862601d38de12ff6adc0c49f608c48c1be76..992c8644eab9da4cc5f958d455b10e811d91e64e 100644 --- a/src/ui/dialog/undo-history.cpp +++ b/src/ui/dialog/undo-history.cpp @@ -218,6 +218,10 @@ UndoHistory::_onListSelectionChange() /* If no event is selected in the view, find the right one and select it. This happens whenever * a branch we're currently in is collapsed. */ + SPDesktop* desktop = getDesktop(); + if (desktop) { + desktop->selection->clear(); + } if (!selected) { EventLog::iterator curr_event = _event_log->getCurrEvent(); @@ -325,6 +329,10 @@ UndoHistory::_onExpandEvent(const Gtk::TreeModel::iterator &iter, const Gtk::Tre void UndoHistory::_onCollapseEvent(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &/*path*/) { + SPDesktop* desktop = getDesktop(); + if (desktop) { + desktop->selection->clear(); + } // Collapsing a branch we're currently in is equal to stepping to the last event in that branch if ( iter == _event_log->getCurrEvent() ) { EventLog::const_iterator curr_event_parent = _event_log->getCurrEvent();