Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix delayed titlebar clicks on macOS 27 Beta (#59836)

Anthony Eidec7c11c65c57
diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rs
index f2190f8a400..8fb2e2254b8 100644
--- a/crates/gpui/src/platform.rs
+++ b/crates/gpui/src/platform.rs
@@ -1495,7 +1495,12 @@ pub struct WindowOptions {
/// The kind of window to create
pub kind: WindowKind,
- /// Whether the window should be movable by the user
+ /// Whether the window should be movable by the user.
+ ///
+ /// On macOS 27, custom titlebar windows that implement their own drag behavior
+ /// with [`Window::start_window_move`] should set this to `false`; otherwise
+ /// AppKit can treat the titlebar region as system-owned and delay clicks
+ /// while disambiguating titlebar double-clicks.
pub is_movable: bool,
/// Whether the window should be resizable by the user
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs
index 9aef0103258..3709a6c4b42 100644
--- a/crates/zed/src/zed.rs
+++ b/crates/zed/src/zed.rs
@@ -377,7 +377,8 @@ pub fn build_window_options(display_uuid: Option<Uuid>, cx: &mut App) -> WindowO
focus: false,
show: false,
kind: WindowKind::Normal,
- is_movable: true,
+ // Zed handles window movement itself, so disable AppKit's titlebar dragging.
+ is_movable: false,
display_id: display.map(|display| display.id()),
window_background: cx.theme().window_background_appearance(),
app_id: Some(app_id.to_owned()),