summaryrefslogtreecommitdiffstats
path: root/src/event-context.cpp
diff options
context:
space:
mode:
authorDiederik van Lierop <mail@diedenrezi.nl>2009-04-03 09:44:31 +0000
committerdvlierop2 <dvlierop2@users.sourceforge.net>2009-04-03 09:44:31 +0000
commitc48f433cc646ad6aa40bce28e04e1beaa682a7b3 (patch)
treed840d4b88abe2d3cbcd2df3b20c75d54b6982104 /src/event-context.cpp
parentAdd XDG locations for icons (diff)
downloadinkscape-c48f433cc646ad6aa40bce28e04e1beaa682a7b3.tar.gz
inkscape-c48f433cc646ad6aa40bce28e04e1beaa682a7b3.zip
Fix middle-mouse-button-zooming in node-context with snap-delay enabled
(bzr r7614)
Diffstat (limited to 'src/event-context.cpp')
-rw-r--r--src/event-context.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/event-context.cpp b/src/event-context.cpp
index bf98d98d3..88b17e001 100644
--- a/src/event-context.cpp
+++ b/src/event-context.cpp
@@ -1180,6 +1180,14 @@ void sp_event_context_snap_delay_handler(SPEventContext *ec, SPItem* const item,
bool const c2 = event->state & GDK_BUTTON3_MASK; // pressed, e.g. when scrolling with the middle mouse button; if we do then
// Inkscape will get stuck in an unresponsive state
+ if (c1 || c2) {
+ // Make sure that we don't send any pending snap events to a context if we know in advance
+ // that we're not going to snap any way (e.g. while scrolling with middle mouse button)
+ // Any motion event might affect the state of the context, leading to unexpected behavior
+ delete ec->_delayed_snap_event;
+ ec->_delayed_snap_event = NULL;
+ }
+
if (ec->_snap_window_open && !c1 && !c2 && ec->desktop && ec->desktop->namedview->snap_manager.snapprefs.getSnapEnabledGlobally()) {
// Snap when speed drops below e.g. 0.02 px/msec, or when no motion events have occurred for some period.
// i.e. snap when we're at stand still. A speed threshold enforces snapping for tablets, which might never