Skip to content

fix: prevent traffic light buttons flashing on deminiaturize#50183

Merged
jkleinsc merged 2 commits intomainfrom
fix-traffic-flash
Mar 11, 2026
Merged

fix: prevent traffic light buttons flashing on deminiaturize#50183
jkleinsc merged 2 commits intomainfrom
fix-traffic-flash

Conversation

@codebytere
Copy link
Copy Markdown
Member

@codebytere codebytere commented Mar 10, 2026

Description of Change

Fixes #50099

When a window with a custom trafficLightPosition is minimized and restored, macOS re-layouts the title bar container during the deminiaturize animation, causing the traffic light buttons to briefly appear at their default position before being repositioned.

Fix this by hiding the buttons container in windowWillMiniaturize and restoring them (with a redraw to the correct position) in windowDidDeminiaturize.

Tested with https://gist.github.com/rubywwwilde/031350b7c4d91f5afc0e2cff51bb6173

Fixes #50099

Checklist

Release Notes

Notes: Fixed an issue where traffic light buttons would flash at position (0,0) when restoring a window with a custom trafficLightPosition from minimization on macOS.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/39-x-y PR should also be added to the "39-x-y" branch. target/40-x-y PR should also be added to the "40-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. labels Mar 10, 2026
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 10, 2026
@nikwen
Copy link
Copy Markdown
Member

nikwen commented Mar 10, 2026

Mark as "Fixes #50099"?

Copy link
Copy Markdown
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a comment about reusing the new functions.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Mar 11, 2026
When a window with a custom `trafficLightPosition` is minimized and
restored, macOS re-layouts the title bar container during the
deminiaturize animation, causing the traffic light buttons to briefly
appear at their default position before being repositioned.

Fix this by hiding the buttons container in `windowWillMiniaturize` and
restoring them (with a redraw to the correct position) in
`windowDidDeminiaturize`.
@jkleinsc jkleinsc merged commit c8dd0b9 into main Mar 11, 2026
62 checks passed
@jkleinsc jkleinsc deleted the fix-traffic-flash branch March 11, 2026 17:02
@release-clerk
Copy link
Copy Markdown

release-clerk bot commented Mar 11, 2026

Release Notes Persisted

Fixed an issue where traffic light buttons would flash at position (0,0) when restoring a window with a custom trafficLightPosition from minimization on macOS.

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 11, 2026

I have automatically backported this PR to "40-x-y", please check out #50207

@trop trop bot added in-flight/40-x-y and removed target/40-x-y PR should also be added to the "40-x-y" branch. labels Mar 11, 2026
@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 11, 2026

I have automatically backported this PR to "39-x-y", please check out #50208

@trop
Copy link
Copy Markdown
Contributor

trop bot commented Mar 11, 2026

I have automatically backported this PR to "41-x-y", please check out #50209

@trop trop bot added in-flight/41-x-y merged/40-x-y PR was merged to the "40-x-y" branch. merged/39-x-y PR was merged to the "39-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. and removed target/39-x-y PR should also be added to the "39-x-y" branch. target/41-x-y PR should also be added to the "41-x-y" branch. in-flight/40-x-y in-flight/39-x-y in-flight/41-x-y labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/39-x-y PR was merged to the "39-x-y" branch. merged/40-x-y PR was merged to the "40-x-y" branch. merged/41-x-y PR was merged to the "41-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trafficLightPosition buttons flash at (0,0) on minimize/restore (macOS)

5 participants