summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2014-02-28 02:46:20 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2014-02-28 02:46:20 +0000
commit58301f7eaa81359ecd10506cbbe73d35060d6a9b (patch)
tree8958b55a62dc90139366bce56e4cec0dc36b9122 /src/desktop.cpp
parentremove some unnecessary copying/casting (diff)
downloadinkscape-58301f7eaa81359ecd10506cbbe73d35060d6a9b.tar.gz
inkscape-58301f7eaa81359ecd10506cbbe73d35060d6a9b.zip
Work around a crash in the Undo History dialog caused by incorrect
modifications to the XML when ensureUpToDate() is called during SPDesktop initialization. The underlying problem remains to be fixed. (bzr r13071)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 364b5e930..a02baeac8 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -52,6 +52,7 @@
#include "display/sp-canvas.h"
#include "display/sp-canvas-util.h"
#include "document.h"
+#include "document-undo.h"
#include "event-log.h"
#include "helper/action-context.h"
#include "interface.h"
@@ -167,8 +168,23 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas, Inkscape::UI::View::EditWid
canvas = aCanvas;
SPDocument *document = namedview->document;
- /* Kill flicker */
+ /* XXX:
+ * ensureUpToDate() sends a 'modified' signal to the root element.
+ * This is reportedly required to prevent flickering after the document
+ * loads. However, many SPObjects write to their repr in response
+ * to this signal. This is apparently done to support live path effects,
+ * which rewrite their result paths after each modification of the base object.
+ * This causes the generation of an incomplete undo transaction,
+ * which causes problems down the line, including crashes in the
+ * Undo History dialog.
+ *
+ * For now, this is handled by disabling undo tracking during this call.
+ * A proper fix would involve modifying the way ensureUpToDate() works,
+ * so that the LPE results are not rewritten.
+ */
+ Inkscape::DocumentUndo::setUndoSensitive(document, false);
document->ensureUpToDate();
+ Inkscape::DocumentUndo::setUndoSensitive(document, true);
/* Setup Dialog Manager */
_dlg_mgr = &Inkscape::UI::Dialog::DialogManager::getInstance();