From 35649d3846d690ad444db4645156995baba945ff Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Tue, 14 Jan 2014 23:02:41 +0100 Subject: Fix for Bug #1268778 (Move cursor disappears after clicking on Select Tool (F1) twice). Fixed bugs: - https://launchpad.net/bugs/1268778 (bzr r12931) --- src/desktop.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/desktop.cpp') 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); } /** -- cgit v1.2.3 From c31b1410b8b7d9059561e8102a38402a999f4aef Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Wed, 15 Jan 2014 13:21:45 +0100 Subject: Additional fix for Bug #1268778 (Move cursor disappears after clicking on Select Tool (F1) twice). Fixed bugs: - https://launchpad.net/bugs/1268778 (bzr r12932) --- src/desktop.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/desktop.cpp') 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); -- cgit v1.2.3 From 73317394a0079e3602e6c596f8d2a249d5b4a114 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Mon, 20 Jan 2014 19:06:46 +0100 Subject: Fix for bug #1270287 (The toolbox buttons toggle between being pressed and released). Fixed bugs: - https://launchpad.net/bugs/1270287 (bzr r12961) --- src/desktop.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index bf3b70d43..364b5e930 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -668,6 +668,7 @@ void SPDesktop::set_event_context2(const std::string& toolName) old_tool->finish(); delete old_tool; } else { + _event_context_changed_signal.emit(this, event_context); return; } } -- cgit v1.2.3 From 58301f7eaa81359ecd10506cbbe73d35060d6a9b Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 28 Feb 2014 03:46:20 +0100 Subject: 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) --- src/desktop.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/desktop.cpp') 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(); -- cgit v1.2.3 From e7a3f5b74d1f5a95390ee95b06371d184c1812f7 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 13 Mar 2014 05:45:38 +0100 Subject: Provide a toggle in the document properties to optionally turn off antialiasing for display and export. Fixes a nearly 10 year old bug #170356 Fixed bugs: - https://launchpad.net/bugs/170356 (bzr r13144) --- src/desktop.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index a02baeac8..234831e69 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1736,6 +1736,8 @@ static void _namedview_modified (SPObject *obj, guint flags, SPDesktop *desktop) if (flags & SP_OBJECT_MODIFIED_FLAG) { + desktop->getDocument()->getRoot()->setAntialiasing(nv->antialiasing); + /* Show/hide page background */ if (nv->pagecolor | (0xff != 0xffffffff)) { sp_canvas_item_show (desktop->table); -- cgit v1.2.3 From 32ef25632164e5af8766a5364400b579edde4ebf Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Thu, 13 Mar 2014 23:37:07 +0100 Subject: Reimplement global aliasing toggle as a 'shape-rendering' property on the root element. (bzr r13146) --- src/desktop.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index 234831e69..a02baeac8 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1736,8 +1736,6 @@ static void _namedview_modified (SPObject *obj, guint flags, SPDesktop *desktop) if (flags & SP_OBJECT_MODIFIED_FLAG) { - desktop->getDocument()->getRoot()->setAntialiasing(nv->antialiasing); - /* Show/hide page background */ if (nv->pagecolor | (0xff != 0xffffffff)) { sp_canvas_item_show (desktop->table); -- cgit v1.2.3 From df81a0651a143161602542fa98558a96feda1f0f Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 24 Mar 2014 20:41:57 +0100 Subject: fix potential calls on nullptr (bzr r13194) --- src/desktop.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index a02baeac8..6b5f696e0 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -1537,7 +1537,9 @@ SPDesktop::updateCanvasNow() void SPDesktop::setDocument (SPDocument *doc) { - if (this->doc() && doc) { + if (!doc) return; + + if (this->doc()) { namedview->hide(this); this->doc()->getRoot()->invoke_hide(dkey); } -- cgit v1.2.3 From 505bff7c923d7cc223c870560343049c960e764a Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 24 Mar 2014 20:43:21 +0100 Subject: fix potential call on nullptr (bzr r13195) --- src/desktop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index 6b5f696e0..22c00d4f1 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -663,8 +663,8 @@ SPDesktop::change_document (SPDocument *theDocument) SPDesktopWidget *dtw = (SPDesktopWidget *) parent->get_data("desktopwidget"); if (dtw) { dtw->desktop = this; + dtw->updateNamedview(); } - dtw->updateNamedview(); _namedview_modified (namedview, SP_OBJECT_MODIFIED_FLAG, this); _document_replaced_signal.emit (this, theDocument); -- cgit v1.2.3