Skip to content

fix: force repaint on system resume to prevent white screen on macOS wake - #536

Merged
itsbkm merged 1 commit into
mainfrom
fix/sleep-wake-white-screen
Aug 27, 2026
Merged

fix: force repaint on system resume to prevent white screen on macOS wake#536
itsbkm merged 1 commit into
mainfrom
fix/sleep-wake-white-screen

Conversation

@itsbkm

@itsbkm itsbkm commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • macOS sleep/wake can leave Chromium's GPU compositor stuck without repainting, leaving the window fully white until the user force-quits the app. The renderer process stays alive the whole time, so the existing render-process-gone crash handler never fires.
  • Listens for Electron's powerMonitor resume event and nudges the window size by a pixel to force the native compositor to redraw. No webContents.reload() and no loss of in-progress renderer state.

Test plan

  • npm run build — compiles cleanly
  • npm run lint — 0 errors (pre-existing warnings only, unrelated to this change)
  • Manual: put a MacBook running FloCafe to sleep and wake it, confirm the window repaints instead of staying white

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Aug 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a system-resume recovery hook intended to repaint a white Electron window without reloading renderer state.

  • Registers one powerMonitor resume listener during application initialization.
  • After resume, briefly changes the visible window width and restores it to prompt compositor redraw.

Confidence Score: 5/5

The PR appears safe to merge because no blocking failure remains in the established scoring set.

No blocking failure remains.

Important Files Changed

Filename Overview
main/index.ts Adds the one-time power-monitor listener and guarded resize-based repaint recovery; no follow-up-eligible issue was identified.

Reviews (2): Last reviewed commit: "fix: force repaint on system resume to p..." | Re-trigger Greptile

Comment thread main/routes/staff.ts
Comment thread main/routes/staff.ts
…wake

Chromium's GPU compositor can fail to repaint after the display sleeps
and wakes back up, leaving the window blank until force-quit. The
renderer stays alive (render-process-gone never fires), so nothing in
the existing crash-recovery paths catches it. Listen for
powerMonitor's resume event and nudge the window size by a pixel to
force the native compositor to redraw, without reloading webContents
or losing in-progress renderer state.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@itsbkm
itsbkm force-pushed the fix/sleep-wake-white-screen branch from 32dc364 to cf0e1d6 Compare August 27, 2026 20:14
@itsbkm
itsbkm merged commit 747d75e into main Aug 27, 2026
15 checks passed
@itsbkm
itsbkm deleted the fix/sleep-wake-white-screen branch August 27, 2026 20:20
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.

1 participant