Skip to content

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

@rubywwwilde

Description

@rubywwwilde

Electron Fiddle uses titleBarStyle: 'hiddenInset' with a custom traffic light position on macOS. When the window is minimized and restored (via dock click), the traffic light buttons briefly appear at position (0, 0) — the top-left corner of the window frame — then jump to the configured position after approximately 1 second.

Steps to reproduce:

  1. Launch Electron Fiddle on macOS
  2. Minimize the window (Cmd+M or yellow button)
  3. Click the dock icon to restore

Expected: Traffic lights appear at their configured position immediately.
Actual: Traffic lights flash at (0, 0) then jump to the correct position.

Environment: macOS 26.2 (Tahoe)

Fix: Call win.show() on the existing window in the app.on('activate') handler. This forces a state transition that avoids the native macOS redraw timing issue.

app.on('activate', () => {
  if (BrowserWindow.getAllWindows().length === 0) {
    createWindow();
  } else if (win) {
    win.show();
  }
});

This is the same underlying Electron bug reported at https://github.com/electron/electron/issues/XXXXX (replace with your electron issue number once filed).

Note: The flash is most prominent on the first minimize/restore cycle after launching the app. Subsequent minimize/restore cycles either do not reproduce the bug or the flash is too brief to be perceptible.

This issue was drafted with AI assistance and may contain minor inaccuracies in technical details. The described behavior and workaround have been personally verified and reproduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions