fix: trafficLightPosition incorrect with customButtonsOnHover (#48621)

fix: trafficLightPosition incorrect with customButtonsOnHover

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2025-10-21 19:30:49 +02:00 committed by GitHub
commit 3f23e8c93a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.