gpui: Fix title bar clicks being delayed on macOS 27 - #58947
Merged
Conversation
On macOS 27, the system title bar machinery holds single clicks in the title bar region for the double-click interval before delivering them, delaying clicks on controls in our custom title bar. Implement the same SPI Chromium uses (_opaqueRectForWindowMoveWhenInTitlebar) to declare the GPUI view's content opaque for window-move purposes, which scopes the system's title bar gesture handling away from our windows.
cole-miller
approved these changes
Jun 9, 2026
cole-miller
added a commit
that referenced
this pull request
Jun 12, 2026
#59214) (cherry-pick to preview) (#59216) Cherry-pick of #59214 to preview ---- This reverts commit c8554b4. Reverting this because it broke dragging the settings UI window. Closes #59163 Release Notes: - Fixed not being able to drag the settings UI window on macOS. Co-authored-by: Cole Miller <cole@zed.dev>
pull Bot
pushed a commit
to kp-forks/zed
that referenced
this pull request
Jun 12, 2026
…ustries#58947)" (zed-industries#59214) This reverts commit c8554b4. Reverting this because it broke dragging the settings UI window. Closes zed-industries#59163 Release Notes: - Fixed not being able to drag the settings UI window on macOS.
This was referenced Jun 18, 2026
Closed
ypatodkar
pushed a commit
to ypatodkar/zed
that referenced
this pull request
Jun 25, 2026
## 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, zed-industries#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 zed-industries#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.
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
…58947) Fixes a macOS 27 beta regression where clicks on custom titlebar controls were delayed by the system double-click interval. After updating to macOS 27 dev beta, I noticed that our titlebar buttons had a delay before click events took effect. After some digging, I discovered that AppKit can treat that titlebar region as system-owned and delay click delivery while waiting to disambiguate double-clicks. I noticed that Slack had titlebar buttons that weren't affected by the double-click disambiguation delay, so I had Claude dig through the Chromium/Electron codebase to discover what they did differently. Chromium uses a private AppKit SPI, `_opaqueRectForWindowMoveWhenInTitlebar`, that allows them to set what regions should be treated as owned by a view vs. owned by AppKit. My fix uses the same API and returns the view bounds when `NSWindowStyleMask::NSFullSizeContentViewWindowMask` is set, which happens when a GPUI app uses a full-size content view for a custom titlebar. Otherwise, we return bounds of `NSRect::new(NSPoint::new(0., 0.), NSSize::new(0., 0.))` so apps using macOS's native titlebar still work as expected. ### Before https://github.com/user-attachments/assets/ba9e0d2d-b85c-4d98-bc7d-bea00368d9cf ### After https://github.com/user-attachments/assets/b78bd7d4-6b43-48d3-a615-2c7a29e32e71 Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed clicks on titlebar controls being delayed on the macOS 27 beta.
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…58947) Fixes a macOS 27 beta regression where clicks on custom titlebar controls were delayed by the system double-click interval. After updating to macOS 27 dev beta, I noticed that our titlebar buttons had a delay before click events took effect. After some digging, I discovered that AppKit can treat that titlebar region as system-owned and delay click delivery while waiting to disambiguate double-clicks. I noticed that Slack had titlebar buttons that weren't affected by the double-click disambiguation delay, so I had Claude dig through the Chromium/Electron codebase to discover what they did differently. Chromium uses a private AppKit SPI, `_opaqueRectForWindowMoveWhenInTitlebar`, that allows them to set what regions should be treated as owned by a view vs. owned by AppKit. My fix uses the same API and returns the view bounds when `NSWindowStyleMask::NSFullSizeContentViewWindowMask` is set, which happens when a GPUI app uses a full-size content view for a custom titlebar. Otherwise, we return bounds of `NSRect::new(NSPoint::new(0., 0.), NSSize::new(0., 0.))` so apps using macOS's native titlebar still work as expected. ### Before https://github.com/user-attachments/assets/ba9e0d2d-b85c-4d98-bc7d-bea00368d9cf ### After https://github.com/user-attachments/assets/b78bd7d4-6b43-48d3-a615-2c7a29e32e71 Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed clicks on titlebar controls being delayed on the macOS 27 beta.
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ustries#58947)" (zed-industries#59214) (cherry-pick to preview) (zed-industries#59216) Cherry-pick of zed-industries#59214 to preview ---- This reverts commit c5feb35. Reverting this because it broke dragging the settings UI window. Closes zed-industries#59163 Release Notes: - Fixed not being able to drag the settings UI window on macOS. Co-authored-by: Cole Miller <cole@zed.dev>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
…ustries#58947)" (zed-industries#59214) This reverts commit c5feb35. Reverting this because it broke dragging the settings UI window. Closes zed-industries#59163 Release Notes: - Fixed not being able to drag the settings UI window on macOS.
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
## 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, zed-industries#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 zed-industries#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.
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.
Fixes a macOS 27 beta regression where clicks on custom titlebar controls were delayed by the system double-click interval.
After updating to macOS 27 dev beta, I noticed that our titlebar buttons had a delay before click events took effect. After some digging, I discovered that AppKit can treat that titlebar region as system-owned and delay click delivery while waiting to disambiguate double-clicks. I noticed that Slack had titlebar buttons that weren't affected by the double-click disambiguation delay, so I had Claude dig through the Chromium/Electron codebase to discover what they did differently.
Chromium uses a private AppKit SPI,
_opaqueRectForWindowMoveWhenInTitlebar, that allows them to set what regions should be treated as owned by a view vs. owned by AppKit. My fix uses the same API and returns the view bounds whenNSWindowStyleMask::NSFullSizeContentViewWindowMaskis set, which happens when a GPUI app uses a full-size content view for a custom titlebar. Otherwise, we return bounds ofNSRect::new(NSPoint::new(0., 0.), NSSize::new(0., 0.))so apps using macOS's native titlebar still work as expected.Before
Screen.Recording.2026-06-09.at.2.00.10.PM.mov
After
Screen.Recording.2026-06-09.at.2.01.11.PM.mov
Self-Review Checklist:
Release Notes: