From ac2c92f3629f40e7a8f2c3a357a5e0d9df8f6105 Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Fri, 3 Apr 2009 09:44:31 +0000 Subject: [PATCH] Fix middle-mouse-button-zooming in node-context with snap-delay enabled --- src/event-context.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.30.2