gpui_macos: Fix traffic light hitbox after repositioning (#58534)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

This is a follow up to https://github.com/zed-industries/zed/pull/58169
and https://github.com/zed-industries/zed/pull/58518 after removing a
bunch of unsafe usage.

Before this, GPUI moved traffic lights by directly changing the native
button frames inside AppKit’s existing titlebar layout and the old
y-coordinate was based on the native titlebar height, so the buttons
moved visually while the titlebar tracking geometry could still be based
on the old layout.

Now the native titlebar container is resized and repositioned to contain
the traffic lights. We capture the original AppKit titlebar/button
frames, resize the titlebar container to fit the requested position,
move the native close/minimize/zoom buttons inside that container and
update AppKit tracking areas. This keeps the visible buttons and
hover/click geometry aligned.

### Before


https://github.com/user-attachments/assets/77dde6cb-3fc8-4166-bc86-22cf2c93e119

### After


https://github.com/user-attachments/assets/da84ade6-ef47-4e53-ae4a-3779315773f9

---------

Co-authored-by: Yara 🏳️‍⚧️ <git@yara.blue>
138139f830Mayank Verma committed on 6/12/2026, 2:08:25 PM· committed by GitHubparente5b6041
5 files changedLine totals unavailable