summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/control-point.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/tool/control-point.cpp')
-rw-r--r--src/ui/tool/control-point.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp
index a03a8b639..b9a793ca4 100644
--- a/src/ui/tool/control-point.cpp
+++ b/src/ui/tool/control-point.cpp
@@ -378,10 +378,15 @@ bool ControlPoint::_eventHandler(GdkEvent *event)
case GDK_BUTTON_RELEASE:
if (_event_grab && event->button.button == 1) {
- // TODO I think snapping on release is wrong, or at least counter-intuitive.
- sp_event_context_snap_watchdog_callback(_desktop->event_context->_delayed_snap_event);
- sp_event_context_discard_delayed_snap_event(_desktop->event_context);
- _desktop->snapindicator->remove_snaptarget();
+ // If we have any pending snap event, then invoke it now!
+ // (This is needed because we might not have snapped on the latest GDK_MOTION_NOTIFY event
+ // if the mouse speed was too high. This is inherent to the snap-delay mechanism.
+ // We must snap at some point in time though, and this is our last chance)
+ // PS: For other contexts this is handled already in sp_event_context_item_handler or
+ // sp_event_context_root_handler
+ if (_desktop->event_context->_delayed_snap_event) {
+ sp_event_context_snap_watchdog_callback(_desktop->event_context->_delayed_snap_event);
+ }
sp_canvas_item_ungrab(_canvas_item, event->button.time);
_setMouseover(this, event->button.state);