Fix regression of main window dragging on Windows - #59967
Merged
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @milkowski on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
Contributor
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
milkowski
force-pushed
the
windows-drag-fix
branch
from
June 26, 2026 21:28
dd90293 to
8dd5d61
Compare
`is_movable` is now false only on macOS (preserving the macOS 27 Beta titlebar-click fix from PR zed-industries#59836) and true everywhere else, restoring native window dragging on Windows.
milkowski
force-pushed
the
windows-drag-fix
branch
from
June 27, 2026 20:58
8dd5d61 to
a8ec09c
Compare
5 tasks
reflectronic
approved these changes
Jun 29, 2026
reflectronic
left a comment
Member
There was a problem hiding this comment.
The way the title bar dragging works in GPUI is a bit messed up, unfortunately, but this will do for now.
Contributor
related PR |
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
## Summary This PR fixes the issue with main Zed window which cannot be moved by dragging the title bar on Windows. ## Root cause `is_movable: false` was set for macOS but breaks Windows `crates/zed/src/zed.rs:381` sets `is_movable: false` for the main window, introduced by commit `f725e90385` (PR zed-industries#59836) to fix macOS 27 Beta titlebar click delays. The comment says "disable AppKit's titlebar dragging", but the setting applies to all platforms, including Windows. ## Why it breaks on Windows On Windows, window dragging relies on `WM_NCHITTEST` returning `HTCAPTION`, not `start_window_move()` (which is an empty no-op on Windows - `crates/gpui/src/platform.rs:703`, never overridden in `gpui_windows`). The hit test at `crates/gpui_windows/src/events.rs:903-904` gates `HTCAPTION` on `is_movable`: ```rust WindowControlArea::Drag if self.is_movable => Some(HTCAPTION as _), WindowControlArea::Drag => None, ``` Since `is_movable` is false, `HTCAPTION` is never returned, the title bar is treated as client area (`HTCLIENT`), mouse events go to gpui's `on_mouse_move` handler (`crates/platform_title_bar/src/platform_title_bar.rs:218`), which calls `window.start_window_move()`, which does nothing on Windows. On macOS this works because `start_window_move()` IS implemented (`crates/gpui_macos/src/window.rs:1801`, using `performWindowDragWithEvent`). ## Test The fix was successfully built and tested on Windows 11 platform. --- Release Notes: - N/A
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.
Summary
This PR fixes the issue with main Zed window which cannot be moved by dragging the title bar on Windows.
Root cause
is_movable: falsewas set for macOS but breaks Windowscrates/zed/src/zed.rs:381setsis_movable: falsefor the main window, introduced by commitec7c11c65c(PR #59836) to fix macOS 27 Beta titlebar click delays. The comment says "disable AppKit's titlebar dragging", but the setting applies to all platforms, including Windows.Why it breaks on Windows
On Windows, window dragging relies on
WM_NCHITTESTreturningHTCAPTION, notstart_window_move()(which is an empty no-op on Windows -crates/gpui/src/platform.rs:703, never overridden ingpui_windows).The hit test at
crates/gpui_windows/src/events.rs:903-904gatesHTCAPTIONonis_movable:Since
is_movableis false,HTCAPTIONis never returned, the title bar is treated as client area (HTCLIENT), mouse events go to gpui'son_mouse_movehandler (crates/platform_title_bar/src/platform_title_bar.rs:218), which callswindow.start_window_move(), which does nothing on Windows.On macOS this works because
start_window_move()IS implemented (crates/gpui_macos/src/window.rs:1801, usingperformWindowDragWithEvent).Test
The fix was successfully built and tested on Windows 11 platform.
Release Notes: