DYN-10464 Fix orbit wheel persisting after releasing ESC key mid-orbit in 3D preview#17096
DYN-10464 Fix orbit wheel persisting after releasing ESC key mid-orbit in 3D preview#17096Copilot wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-10464
Agent-Logs-Url: https://github.com/DynamoDS/Dynamo/sessions/d7d560c9-9a6b-436f-b646-84c9cc255ac9 Co-authored-by: johnpierson <15744724+johnpierson@users.noreply.github.com>
… expression' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR addresses a UI input-edge-case in Dynamo’s WPF 3D background preview: when the user enters background navigation via holding ESC, starts an orbit gesture, and then releases ESC mid-gesture, HelixToolkit’s mouse capture can persist and leave the orbit wheel indicator visible. The fix explicitly releases mouse capture from the viewport during the ESC key-up transition back to graph view.
Changes:
- Added
Watch3DView.ReleaseViewportMouseCapture()to release HelixToolkit/WPF mouse capture when the 3D viewport (or its children) currently holds it. - Updated
DynamoView_KeyUpto callBackgroundPreview?.ReleaseViewportMouseCapture()when ESC is released while background navigation is active.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/DynamoCoreWpf/Views/Preview/Watch3DView.xaml.cs | Adds a small helper to release viewport mouse capture to terminate ongoing camera gestures. |
| src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs | Invokes the helper on ESC key release during background navigation to ensure the orbit indicator is dismissed. |
HelixToolkit's MouseGestureHandler subscribes to MouseUp (in Execute()) to call Completed() -> HideTargetAdorner(), but has no LostMouseCapture handler. Releasing WPF mouse capture alone therefore never cleans up the gesture state or hides the orbit wheel indicator. Fix: after Mouse.Capture(null), raise a synthetic right-button MouseUp on the viewport so HelixToolkit's OnMouseUp fires, completing the gesture and dismissing the orbit indicator immediately when the user releases ESC. The synthetic MouseButton.Right event is safe for NodeManipulator.MouseUp, which guards early on non-left-button events. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
The smoke test that is failing is ExitDynamo 🤔 |
That one is flaky. |
johnpierson
left a comment
There was a problem hiding this comment.
right off hand, this all seems innocent enough to me and is working well in my testing.



Purpose
DYN-10464: When holding ESC to enter 3D navigation mode and starting a right-click orbit gesture, releasing ESC mid-orbit left the HelixToolkit orbit wheel indicator visible until the right mouse button was physically released.
Root cause:
DynamoView_KeyUpcalledMouse.Capture(null)to release WPF mouse capture, but HelixToolkit'sMouseGestureHandlerhas noLostMouseCapturehandler. Its cleanup path (Completed()→HideTargetAdorner()) is only reachable viaOnMouseUp. Releasing capture alone therefore never dismissed the orbit indicator.Key changes:
Watch3DView.xaml.cs—ReleaseViewportMouseCapture()now raises a synthetic right-buttonMouseUpevent on the viewport after releasing capture. This triggers HelixToolkit'sOnMouseUpsubscriber (registered inExecute()when the gesture started), which callsCompleted()→HideTargetAdorner()and properly ends the gesture.DynamoView.xaml.cs— unchanged from prior commit;DynamoView_KeyUpcallsBackgroundPreview?.ReleaseViewportMouseCapture()when ESC is released whileCanNavigateBackgroundis true.The synthetic
MouseButton.Rightevent is safe:NodeManipulator.MouseUp(the only otherViewMouseUpsubscriber) guards withif (e.ChangedButton != MouseButton.Left) return.Declarations
Check these if you believe they are true
Release Notes
Fixed: orbit wheel indicator no longer persists in the 3D preview after releasing ESC mid-orbit.
Reviewers
@DynamoDS/eidos
FYIs
(FILL ME IN, Optional)