From 6e9910303b8b3679cf125e9592ddccd2417591d0 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sat, 1 Aug 2026 02:35:29 +0200 Subject: [PATCH] Design: a sketch takes its floating chrome with it when it ends MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Confirming a sketch while an inline value field was open left the field behind. The editor is a top-level frame, so it survived the session that owned it, and inline_busy stayed set with it — on_mouse_impl then returned true at its first branch for every later click and the viewport was simply dead. No refusal, no message: exactly the "click the geometry, nothing happens" the pick bugs above it were mistaken for. finish() and cancel() now call close_session_chrome(): dismiss the open field (keep-as-drawn, the same contract the polyline terminators already use), drop the queue of fields behind it, and clear the corner readout — which had the same defect for the same reason, sitting on 336.8° over a committed sketch because nothing redraws the HUD once the tool stops. Verified on the rig on the exact reported sequence: line on XZ, Return to accept the length, Confirm with the Angle field still open. The field goes, the sketch commits, and the next click reaches the pick (pick trace shows down/up consumed) and selects Sketch1. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM --- src/slic3r/GUI/DesignSketchTool.cpp | 6 ++++++ src/slic3r/GUI/DesignSketchTool.hpp | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/slic3r/GUI/DesignSketchTool.cpp b/src/slic3r/GUI/DesignSketchTool.cpp index 9ca55025d8..65d1e91212 100644 --- a/src/slic3r/GUI/DesignSketchTool.cpp +++ b/src/slic3r/GUI/DesignSketchTool.cpp @@ -236,6 +236,7 @@ void DesignSketchTool::set_tool(Mode mode) void DesignSketchTool::cancel() { + close_session_chrome(); // same orphaned-field freeze as finish() — see snaporca-yce m_active = false; m_points.clear(); m_entities.clear(); @@ -2009,6 +2010,11 @@ void DesignSketchTool::keep_segment_as_drawn() void DesignSketchTool::finish() { + // A value field still open at commit time outlives the session — the editor is a top-level + // frame — and inline_busy stays set, so every later click is swallowed at on_mouse_impl's + // first branch and the viewport reads as dead. Dismiss it first (keep-as-drawn, the same + // contract as the polyline terminators) and drop any queued field with it. + close_session_chrome(); if (op_ready()) confirm_op(); // apply a pending edit-op gizmo before committing if (tf_ready()) confirm_transform(); // apply a pending transform gizmo before committing auto cb = on_commit_entities; diff --git a/src/slic3r/GUI/DesignSketchTool.hpp b/src/slic3r/GUI/DesignSketchTool.hpp index d72c149974..cd8dc8ef59 100644 --- a/src/slic3r/GUI/DesignSketchTool.hpp +++ b/src/slic3r/GUI/DesignSketchTool.hpp @@ -357,6 +357,16 @@ public: m_autoedit_seen = int(m_entities.size()); m_live_quotes.clear(); // rebuilt from current geometry on the next render } + // Take down the session's floating chrome: the open value field (dismiss = keep-as-drawn), + // the queue of fields behind it, and the corner readout. All three are top-level windows fed + // only while the tool is live, so nothing else would ever clear them — reset_autoedit() alone + // clears the flag and leaves the frame on screen. Called by finish()/cancel(); safe when + // nothing is open. + void close_session_chrome() { + if (on_inline_dismiss) on_inline_dismiss(); // no-op when no field is open + reset_autoedit(); + if (on_readout) on_readout(std::string()); // the HUD is not redrawn once the tool stops + } // Ctrl+Z while sketching: drop the last drawn entity (reuses delete_selected's remap). bool undo_last_entity() { if (!m_active || m_entities.empty()) return false;