Repository navigation
fix: stop clicks in the main window from starting a native window drag - #429
Merged
Merged
Conversation
Since #413 made the main window movable, a drag on the sidebar resizer band moved the window instead of resizing the sidebar. Keep the main window immovable while AppKit dispatches each left mouse-down, the same way the folder-icon guard already did, and restore it afterwards so the Window menu tiling items still validate.
An unshown window dropped the synthetic mouse-down before hit-testing, so the recorder never saw it, and NSHostingView does not route clicks to raw AppKit subviews. Show the window and host the recorder via NSViewRepresentable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Dragging the sidebar's right edge moved the whole window instead of resizing the sidebar. This puts the fix on main. #428 merged with only its failing test, so main CI is red until this lands.
The main window stays
isMovableso the Window menu tiling items (Fill, Center) stay enabled. But a plain left mouse-down in the main window is now dispatched with movability off, so it can't start a native window drag. The real drag surfaces (the titlebar and drag handles) already turn movability back on around their own drags. Settings and Debug windows are unaffected.Test plan
testMainWindowMouseDownDispatchKeepsWindowImmovableThenRestoresMovable(added in fix: sidebar edge drag moves the window instead of resizing the sidebar #428) passestestNonMainWindowMouseDownDispatchLeavesWindowMovablepasses