From ec7c11c65c577ee6b477ced99d41eb86636b6b2e Mon Sep 17 00:00:00 2001 From: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com> Date: Thu, 25 Jun 2026 14:25:41 -0400 Subject: [PATCH] Fix delayed titlebar clicks on macOS 27 Beta (#59836) ## Summary macOS 27 Beta delays clicks in titlebar regions while AppKit determines whether a gesture should become a drag, single click, or double click. Zed's main workspace windows render a custom titlebar that already handles window movement via `Window::start_window_move`, so they do not need AppKit's native movable-titlebar behavior. This sets `is_movable` to `false` for the main `MultiWorkspace` windows and documents the `WindowOptions::is_movable` caveat for GPUI users with custom titlebars. ## Background The previous fix for this, #58947, used AppKit's private `_opaqueRectForWindowMoveWhenInTitlebar` SPI to mark GPUI's full-size content view as app-owned titlebar content. That fixed delayed titlebar clicks, but was later reverted in #59214 because it also affected windows that rely on AppKit's native titlebar dragging, like the settings window. This PR takes a narrower approach by only changing Zed's main custom-titlebar windows. Those windows already implement dragging explicitly via `Window::start_window_move`, so disabling AppKit's native movable-titlebar behavior fixes the macOS 27 Beta click delay without affecting other window types. Release Notes: - Fixed delayed clicks in the custom titlebar on macOS 27 Beta. --- crates/gpui/src/platform.rs | 7 ++++++- crates/zed/src/zed.rs | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) 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, 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()),