summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2006-07-23 03:32:23 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2006-07-23 03:32:23 +0000
commite12fb519c55f93d11a13c162daa3572e7fc02b3e (patch)
tree7d73a9c5ad47df2e65a0338c438365f7320b963a /src
parentpatch from John Bintz, adding pref to simplify multiple paths separately (diff)
downloadinkscape-e12fb519c55f93d11a13c162daa3572e7fc02b3e.tar.gz
inkscape-e12fb519c55f93d11a13c162daa3572e7fc02b3e.zip
Forced redraw of canvas upon document commit to work around event starvation issue at high zoom levels
(bzr r1458)
Diffstat (limited to 'src')
-rw-r--r--src/desktop.cpp8
-rw-r--r--src/desktop.h1
-rw-r--r--src/document-private.h1
-rw-r--r--src/document-undo.cpp2
-rw-r--r--src/document.cpp6
-rw-r--r--src/document.h2
6 files changed, 19 insertions, 1 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 49a43bc37..cbd5ffa60 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -248,7 +248,9 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas)
_reconstruction_finish_connection =
document->connectReconstructionFinish(sigc::bind(sigc::ptr_fun(_reconstruction_finish), this));
_reconstruction_old_layer_id = NULL;
-
+
+ _commit_connection = document->connectCommit(sigc::bind(sigc::ptr_fun(&sp_canvas_update_now), this->canvas));
+
// ?
// sp_active_desktop_set (desktop);
_inkscape = INKSCAPE;
@@ -1048,6 +1050,7 @@ SPDesktop::onRedrawRequested ()
/**
* Associate document with desktop.
*/
+/// \todo fixme: refactor SPDesktop::init to use setDocument
void
SPDesktop::setDocument (SPDocument *doc)
{
@@ -1066,6 +1069,9 @@ SPDesktop::setDocument (SPDocument *doc)
_layer_hierarchy->connectChanged(sigc::bind(sigc::ptr_fun(_layer_hierarchy_changed), this));
_layer_hierarchy->setTop(SP_DOCUMENT_ROOT(doc));
+ _commit_connection.disconnect();
+ _commit_connection = doc->connectCommit(sigc::bind(sigc::ptr_fun(&sp_canvas_update_now), this->canvas));
+
/// \todo fixme: This condition exists to make sure the code
/// inside is called only once on initialization. But there
/// are surely more safe methods to accomplish this.
diff --git a/src/desktop.h b/src/desktop.h
index 0a2d932f8..dde2962a7 100644
--- a/src/desktop.h
+++ b/src/desktop.h
@@ -264,6 +264,7 @@ private:
sigc::connection _sel_changed_connection;
sigc::connection _reconstruction_start_connection;
sigc::connection _reconstruction_finish_connection;
+ sigc::connection _commit_connection;
virtual void onPositionSet (double, double);
virtual void onResized (double, double);
diff --git a/src/document-private.h b/src/document-private.h
index 18d35f446..cb83c9376 100644
--- a/src/document-private.h
+++ b/src/document-private.h
@@ -56,6 +56,7 @@ struct SPDocumentPrivate {
SPDocument::ResizedSignal resized_signal;
SPDocument::ReconstructionStart _reconstruction_start_signal;
SPDocument::ReconstructionFinish _reconstruction_finish_signal;
+ SPDocument::CommitSignal commit_signal;
/* Undo/Redo state */
guint sensitive: 1; /* If we save actions to undo stack */
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index 35b35c888..09bb4e857 100644
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
@@ -162,6 +162,8 @@ sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int ev
}
sp_repr_begin_transaction (doc->rdoc);
+
+ doc->priv->commit_signal.emit();
}
void
diff --git a/src/document.cpp b/src/document.cpp
index 3077198cf..20bbeb73e 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -611,6 +611,12 @@ SPDocument::emitReconstructionFinish(void)
return;
}
+sigc::connection SPDocument::connectCommit(SPDocument::CommitSignal::slot_type slot)
+{
+ return priv->commit_signal.connect(slot);
+}
+
+
void SPDocument::_emitModified() {
static guint const flags = SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG | SP_OBJECT_PARENT_MODIFIED_FLAG;
diff --git a/src/document.h b/src/document.h
index cf2194a95..b0afba5ec 100644
--- a/src/document.h
+++ b/src/document.h
@@ -64,6 +64,7 @@ struct SPDocument : public Inkscape::GC::Managed<>,
typedef sigc::signal<void, double, double> ResizedSignal;
typedef sigc::signal<void> ReconstructionStart;
typedef sigc::signal<void> ReconstructionFinish;
+ typedef sigc::signal<void> CommitSignal;
SPDocument();
~SPDocument();
@@ -93,6 +94,7 @@ struct SPDocument : public Inkscape::GC::Managed<>,
sigc::connection connectModified(ModifiedSignal::slot_type slot);
sigc::connection connectURISet(URISetSignal::slot_type slot);
sigc::connection connectResized(ResizedSignal::slot_type slot);
+ sigc::connection connectCommit(CommitSignal::slot_type slot);
void bindObjectToId(gchar const *id, SPObject *object);
SPObject *getObjectById(gchar const *id);