Repository navigation
fix: sidebar edge drag moves the window instead of resizing the sidebar - #428
Merged
Merged
Conversation
1 of 3 tasks
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 edge moved the whole window instead of resizing the sidebar. That started with #413, which made the main window movable so the Window menu's tiling items would work. This fix keeps those menu items working and stops ordinary clicks in the main window from turning into window drags.
Summary
programa_sendEventinSources/WindowSwizzles.swiftalready setisMovable = falsewhile AppKit dispatched a mouse-down, but only for clicks on folder icons. It now does that for every left mouse-down in a main window (one whose content view is aMainWindowHostingView), and sets it back to true afterwards. Deliberate drag surfaces (WindowDragHandleViewand the titlebar-background fallback) already re-enable it around their ownperformDrag, so window dragging from the top bar still works. Other windows such as Settings and the Debug windows are unaffected.Review order:
00ffb09b2c: regression tests only. CI should fail on the main-window test.7c961f5ff8: the fix and a CHANGELOG line.Test plan
testMainWindowMouseDownDispatchKeepsWindowImmovableThenRestoresMovableWindowMoveSuppressionHitPathTestscases