Fix title bar buttons unclickable on Windows - #12
Merged
JetSquirrel merged 2 commits intoOct 1, 2026
Merged
Conversation
gpui-kit's TitleBar marks its whole content strip as a native WindowControlArea::Drag region. On Windows, WM_NCHITTEST then answers HTCAPTION for every child of the bar: a mouse press is treated as a window move, the click never dispatches, and the press falls into the OS move loop — so the expand-sidebar button did nothing and the language toggle felt stuck. macOS never takes this hit-test path. - Occlude the expand-sidebar, open-data, setup, ui-size and toggle-theme buttons so their hitboxes stop the upward collection and Windows returns HTCLIENT for them; empty bar space still drags. - Consume the left press on the toggle-language button, the same defence gpui-kit's own AppMenuBar uses. - Add headless UI regression tests for the language toggle (switch takes effect, the press does not bubble to ancestors), enabling gpui-kit's test-support feature for the test build.
- Wildcard paths under a drive letter or share (`C:\data\*.csv`) matched nothing: glob() gave up on any path with a prefix component. Start the walk from the drive or share root instead. - canonicalize() returns verbatim paths on Windows (`\?\C:\...`). The `?` read as a pattern, so reopening an attached file failed, and the prefix showed in the sidebar. Strip it for drive and UNC paths. - `~` never expanded or compacted outside a Unix-style shell, because Windows does not set HOME. Fall back to USERPROFILE, as setup.rs does, and accept `\` as a separator. - CI built Windows but ran the tests only on macOS, so none of this surfaced; run them on the Windows job too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
On Windows, every button in the title bar was dead: the expand-sidebar button did nothing, the language toggle felt stuck and never switched, and the Open / setup / UI-size / theme buttons had the same defect.
Root cause
gpui-kit's
TitleBarmarks its whole content strip as a nativeWindowControlArea::Dragregion. On Windows,WM_NCHITTESTthen answersHTCAPTIONfor every child of the bar (gpui's hit-test collects all ancestor hitboxes containing the cursor). A mouse press is treated as a window move: the click event never dispatches, and the unconsumed press falls through toDefWindowProc's modal move loop — hence the "laggy and ineffective" feel. macOS never takes this hit-test path, which is why the bug is Windows-only.Fix
.occlude()to the expand-sidebar, open-data, setup, ui-size and toggle-theme buttons: their hitboxes getBlockMousebehavior, the upward hitbox collection stops there, and Windows returnsHTCLIENT— clicks dispatch normally while empty bar space still drags the window.prevent_default+stop_propagation), the same defence gpui-kit's ownAppMenuBaruses.test-supportfeature in dev-dependencies.Verification
cargo check --bin ducklocal --tests: passescli(13) +lsp(8) tests: all pass, no regressions