Fix macOS Option-click green button zoom behavior - #14716
Conversation
Co-Authored-By: Warp Agent <agent@warp.dev>
|
@warp-agent are there any potential side effects of this change that I should potentially be on the lookout for? I tested the main change and i works fine |
|
Oz run started. |
|
Good question — the diff is two lines, but it changes who handles the click, so there are a handful of second-order behaviors worth keeping an eye on. Context: the code you're changing came from #12557 (fix for #12389, traffic lights + resize edges dead on the macOS 27 beta), which deliberately force-dispatched Most likely to bite
Lower probability, but where I'd look if something weird shows up
Explicitly not affected
Suggested manual pass before merge: macOS 27 beta + macOS 26; all three buttons on both key and background windows; custom titlebar heights (short + tall); option-click zoom → un-zoom → check titlebar height; the green-button tiling menu; and a tab drag-out immediately after clicking a traffic light. |
|
@warp-agent can you test the likely regression cases for me that you mentioned in the comment on the PR and let me know if you see any regressions? |
|
Went through all six at the current head ( Scope of what's behind each verdict. This pass ran on a Linux runner, so I could not build or run the macOS binary in it — First, a correction to my own framing in the earlier commentI said this change "hands back to AppKit" the dispatch that #12557 deliberately forced, implying it re-opens #12389. Having now read #12557's diff, that's not quite right, and the difference matters. Before #12557 there was no case NSEventTypeLeftMouseUp:
[self.contentView mouseUp:event];
break;
case NSEventTypeLeftMouseDragged:
[self.contentView mouseDragged:event];
break;AppKit on 27 needs the mouse-up delivered back through This PR takes the other route: give the down to AppKit and set 1. Traffic-light clicks now depend on AppKit hit-testing — partially applies as residual risk; no regression seen on macOS 26Empirical (macOS 26.3.1, this head): close and minimize work, plain green → fullscreen, Option+green → stays windowed. That's the recording already on this PR. Custom titlebar height — code-reasoned, does not apply. The worry was that AppKit clips hit-tests to a superview's bounds where our explicit Resize edges: untouched — the Not closed: macOS 27 beta. Our cloud runner fleet has a macOS 26 runner but no macOS 27 one, so I can't exercise the original #12389 platform at all. The reasoning above says 27 should be better off than under #12557, but that's an argument, not a click. 2. Window activation/ordering on background windows — code-reasoned: does not apply as a defectNot exercised. Two things: AppKit treats the standard window buttons as first-mouse targets, which is why closing or minimizing a background window of an already-active app works without raising it in stock macOS apps. And in the worst case — the window does raise on the click — that's the platform-standard behaviour, i.e. a delta from Warp's previously non-standard force-dispatch rather than a bug. Worth an eyeball in a multi-window session; not a blocker. 3. Other native green-button affordances now reachable — applies by design; no titlebar-height riskShift/Control-click and the macOS 15+ tiling menu becoming reachable is the intended consequence of routing through AppKit. On whether the custom titlebar survives a plain zoom or tile (code-reasoned): the window frame changes → the 4. Stale
|
|
thank you! |
Upstream 64e3cd4 (warpdotdev#14716). On a left mouse down over a standard window button, sendEvent: sent `mouseDown:` straight at the button and cleared _leftMouseDownStartedInNativeWindowChrome. Bypassing `super sendEvent:` skips AppKit's own zoom-button handling, which is what reads the Option modifier to choose zoom-to-fit rather than maximize, so Option-clicking the green button behaved like a plain click. Now the event goes through `super sendEvent:` and the flag is set YES, so the matching LeftMouseUp/LeftMouseDragged cases also route through super rather than being redispatched at the content view -- consistent with the resize-edge path directly below it. Objective-C only; there is no test surface for it in this repo. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VNUMjBVuwvEnRSgaawUCR3
Description
Fixes macOS titlebar green-button modifier behavior so Option-click routes through AppKit's native window handling and performs zoom (not fullscreen).
In
crates/warpui/src/platform/mac/objc/window.m,WarpWindownow marks standard-window-button mouse-downs as native chrome and routes them through[super sendEvent:event]instead of calling[windowButton mouseDown:event]directly.Linked Issue
Testing
./script/formatcargo check -p warpuicargo test -p warpuicargo clippy -p warpui --all-targets --all-features --tests -- -D warningscargo clippy --workspace --all-targets --all-features --tests -- -D warningsfails on pre-existing, unrelatedwarp_completerlints incrates/warp_completer/src/completer/engine/argument/v2.rs(collapsible-if / let-and-return), outside this PR diff../script/run:Regression harness note: no repo-local automated macOS window-chrome event harness was found for this Objective-C
NSWindowpath, so verification for this bug is live app behavior + visual proof../script/runScreenshots / Videos
Computer-use screenshots
View screenshot: Warp in fullscreen after clicking the green traffic-light button; hovering the top reveals the auto-hidden menu bar and traffic lights (red, disabled-gray minimize, green).
View screenshot: Warp entered macOS fullscreen after a plain green-button click — traffic lights are hidden and content fills the entire screen.
View screenshot: Warp remains a normal window with traffic-light buttons visible after an Option+click on the green button (it did not enter fullscreen).
View screenshot: Warp in a normal windowed state (traffic lights visible) after exiting fullscreen at the end of the demo.
Computer-use video recordings
View video recording: Warp windowed baseline; an Option-modified green traffic-light click (explicit down/up with Option held) that stays windowed; then a plain green click that enters fullscreen; then exiting fullscreen.
Agent Mode
CHANGELOG-BUG-FIX: macOS Option-click on Warp's green traffic-light button now performs zoom instead of entering fullscreen.
Originating thread: https://warpdev.slack.com/archives/C0BDQDW8V5E/p1785857994972379
Co-Authored-By: Warp Agent agent@warp.dev
Conversation: https://staging.warp.dev/conversation/d6074769-a12a-4e3b-bc62-548f9a995321
Run: https://oz.staging.warp.dev/runs/019fcf92-5622-7aba-986d-14124a371466
This PR was generated with Oz.