Skip to content

fix: call win.show() on activate to prevent traffic light position flash#1863

Open
rubywwwilde wants to merge 1 commit intoelectron:mainfrom
rubywwwilde:fix/traffic-light-flash-on-restore
Open

fix: call win.show() on activate to prevent traffic light position flash#1863
rubywwwilde wants to merge 1 commit intoelectron:mainfrom
rubywwwilde:fix/traffic-light-flash-on-restore

Conversation

@rubywwwilde
Copy link

Summary

Fixes #1862

On macOS, when a window using titleBarStyle: 'hiddenInset' with a custom trafficLightPosition is minimized and restored via dock click, the native traffic light buttons briefly flash at position (0,0) before jumping to the configured position ~1 second later.

This happens because macOS renders the traffic lights at their default position during deminiaturization before Electron reapplies the custom position. Calling win.show() in the activate handler forces a state transition that avoids the flash.

Changes

  • Added win.show() call in the app.on('activate') handler after retrieving the existing window

Test plan

  • On macOS, launch Fiddle, minimize window, click dock icon to restore — confirmed traffic lights no longer flash at (0,0)
  • Verified window creation still works when no window exists (closing all windows then clicking dock icon)

Note: This fix addresses a macOS native redraw timing issue that cannot be meaningfully covered by a unit test.

🤖 Generated with Claude Code

On macOS, when a window using `titleBarStyle: 'hiddenInset'` with custom
`trafficLightPosition` is minimized and restored via dock click, the native
traffic light buttons briefly appear at (0,0) before jumping to the configured
position. Calling `win.show()` in the activate handler forces a proper state
transition that avoids this flash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rubywwwilde rubywwwilde requested review from a team and codebytere as code owners March 6, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant