From 955afdd92b818a95a44b37e5a601d9cc755675fd Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 19:30:59 +0200 Subject: [PATCH] fix: `trafficLightPosition` incorrect with `customButtonsOnHover` (#48620) fix: trafficLightPosition incorrect with customButtonsOnHover Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- shell/browser/ui/cocoa/window_buttons_proxy.mm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shell/browser/ui/cocoa/window_buttons_proxy.mm b/shell/browser/ui/cocoa/window_buttons_proxy.mm index de1d6b4630..c0dfd0ac58 100644 --- a/shell/browser/ui/cocoa/window_buttons_proxy.mm +++ b/shell/browser/ui/cocoa/window_buttons_proxy.mm @@ -176,6 +176,13 @@ [button setHidden:hidden]; [button setNeedsDisplay:YES]; } + + // On macOS 26, toggling the hidden state of the standard window buttons can + // cause AppKit to re-layout the title bar container and reset its frame, + // which loses the custom margin adjustments. Re-apply the calculated geometry + // after visibility changes to keep the buttons at the specified margin + // instead of snapping back to the default until the next manual resize. + [self redraw]; } // Return the bounds of all 3 buttons.