From 3af7caa4efa79b1543a582a40031cea07f123c24 Mon Sep 17 00:00:00 2001 From: Ay1nDas Date: Mon, 8 Dec 2025 13:06:35 +0530 Subject: [PATCH 1/2] Fix crash after modifiyng a path with spiro spline Added a guard clause in '_pointDragged' to check if '_grabbed_point' is valid before processing. Fixes: https://gitlab.com/inkscape/inkscape/-/issues/5733 --- src/ui/tool/control-point-selection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ui/tool/control-point-selection.cpp b/src/ui/tool/control-point-selection.cpp index ed131cd7bf..57863e5add 100644 --- a/src/ui/tool/control-point-selection.cpp +++ b/src/ui/tool/control-point-selection.cpp @@ -386,6 +386,10 @@ void ControlPointSelection::_pointGrabbed(SelectableControlPoint *point) void ControlPointSelection::_pointDragged(Geom::Point &new_pos, MotionEvent const &event) { + if (!_grabbed_point) { + return; + } + Geom::Point abs_delta = new_pos - _original_positions[_grabbed_point]; double fdist = Geom::distance(_original_positions[_grabbed_point], _original_positions[_farthest_point]); if (mod_alt_only(event) && fdist > 0) { -- GitLab From 79648fe896c4f8fcae7063276e39f46714bc9641 Mon Sep 17 00:00:00 2001 From: Ay1nDas Date: Thu, 11 Dec 2025 18:47:25 +0530 Subject: [PATCH 2/2] Fix Cursor Dragging still active even after erasing the node When ControlPoint is destroyed while it actively holds the event grab (Occurs when editing path with LPE) - Manually releases the GTK mouse grab ('_canvas_item_ctrl->ungrab()'). - Resets the static '_event_grab' and '_drag_initiated' flags to 'false'. --- src/ui/tool/control-point.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ui/tool/control-point.cpp b/src/ui/tool/control-point.cpp index 7f5729324b..2fb1b7f038 100644 --- a/src/ui/tool/control-point.cpp +++ b/src/ui/tool/control-point.cpp @@ -55,6 +55,17 @@ ControlPoint::ControlPoint(SPDesktop *d, Geom::Point const &initial_pos, SPAncho ControlPoint::~ControlPoint() { + // MUST release the static global lock. + // If this point is being deleted (e.g. by LPE Update) + // while it holds the mouse grab, + // Otherwise, Inkscape thinks we are still dragging. + if (_event_grab) { + _canvas_item_ctrl->ungrab(); + + _event_grab = false; + _drag_initiated = false; + } + // avoid storing invalid points in mouseovered_point if (this == mouseovered_point) { _clearMouseover(); -- GitLab