summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Bintz <me@johnbintz.com>2006-07-23 04:31:19 +0000
committerjohncoswell <johncoswell@users.sourceforge.net>2006-07-23 04:31:19 +0000
commit23a89f90650bd91d1e975deb80ea5e535af89cfe (patch)
tree4df6ae2bcc4540638016fc27d9e7ae24b56a4a98 /src
parentForced redraw of canvas upon document commit to work around event starvation ... (diff)
downloadinkscape-23a89f90650bd91d1e975deb80ea5e535af89cfe.tar.gz
inkscape-23a89f90650bd91d1e975deb80ea5e535af89cfe.zip
added SPDesktop::updateNow() and forced redraw of canvas upon completion of selection or panning to work around event starvation issue at
high zoom levels (bzr r1459)
Diffstat (limited to 'src')
-rw-r--r--src/desktop.cpp11
-rw-r--r--src/desktop.h1
-rw-r--r--src/event-context.cpp1
-rw-r--r--src/node-context.cpp4
-rw-r--r--src/select-context.cpp2
5 files changed, 17 insertions, 2 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index cbd5ffa60..b41862704 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -49,6 +49,7 @@
#endif
#include <glibmm/i18n.h>
+#include <sigc++/functors/mem_fun.h>
#include "macros.h"
#include "inkscape-private.h"
@@ -249,7 +250,7 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas)
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));
+ _commit_connection = document->connectCommit(sigc::mem_fun(*this, &SPDesktop::updateNow));
// ?
// sp_active_desktop_set (desktop);
@@ -1021,6 +1022,12 @@ SPDesktop::emitToolSubselectionChanged(gpointer data)
inkscape_subselection_changed (this);
}
+void
+SPDesktop::updateNow()
+{
+ sp_canvas_update_now(canvas);
+}
+
//----------------------------------------------------------------------
// Callback implementations. The virtual ones are connected by the view.
@@ -1070,7 +1077,7 @@ SPDesktop::setDocument (SPDocument *doc)
_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));
+ _commit_connection = doc->connectCommit(sigc::mem_fun(*this, &SPDesktop::updateNow));
/// \todo fixme: This condition exists to make sure the code
/// inside is called only once on initialization. But there
diff --git a/src/desktop.h b/src/desktop.h
index dde2962a7..8e31e2e7d 100644
--- a/src/desktop.h
+++ b/src/desktop.h
@@ -223,6 +223,7 @@ struct SPDesktop : public Inkscape::UI::View::View
void setToolboxFocusTo (gchar const* label);
void setToolboxAdjustmentValue (gchar const* id, double val);
bool isToolboxButtonActive (gchar const *id);
+ void updateNow();
void fullscreen();
diff --git a/src/event-context.cpp b/src/event-context.cpp
index ab79f999b..92dc711cf 100644
--- a/src/event-context.cpp
+++ b/src/event-context.cpp
@@ -454,6 +454,7 @@ static gint sp_event_context_private_root_handler(SPEventContext *event_context,
desktop->zoom_relative_keep_point(event_dt,
pow(zoom_inc, zoom_power));
gtk_timeout_add(250, (GtkFunction) grab_allow_again, NULL);
+ desktop->updateNow();
}
if (panning == event->button.button) {
panning = 0;
diff --git a/src/node-context.cpp b/src/node-context.cpp
index f38985c71..8f8a48bf7 100644
--- a/src/node-context.cpp
+++ b/src/node-context.cpp
@@ -452,6 +452,7 @@ sp_node_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
} else {
sp_nodepath_select_segment_near_point(nc->nodepath, nc->curvepoint_doc, false);
}
+ desktop->updateNow();
}
break;
case GDK_2BUTTON_PRESS:
@@ -464,8 +465,10 @@ sp_node_context_item_handler(SPEventContext *event_context, SPItem *item, GdkEve
}
} else if (event->button.state & GDK_SHIFT_MASK) {
selection->toggle(item_clicked);
+ desktop->updateNow();
} else {
selection->set(item_clicked);
+ desktop->updateNow();
}
ret = TRUE;
@@ -636,6 +639,7 @@ sp_node_context_root_handler(SPEventContext *event_context, GdkEvent *event)
}
ret = TRUE;
Inkscape::Rubberband::get()->stop();
+ desktop->updateNow();
nc->rb_escaped = false;
nc->drag = FALSE;
nc->hit = false;
diff --git a/src/select-context.cpp b/src/select-context.cpp
index 7027de1ef..6cffdc076 100644
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
@@ -610,6 +610,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
sp_canvas_item_ungrab(sc->grabbed, event->button.time);
sc->grabbed = NULL;
}
+
+ desktop->updateNow();
}
sc->button_press_shift = false;
sc->button_press_ctrl = false;