-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(desktop): eliminate white flash on window resize #1380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /** | ||
| * Native-window background colors that match the app's CSS theme tokens. | ||
| * | ||
| * Dark → `color-mix(in srgb, neutral-950 95%, white)` ≈ #161616 | ||
| * Light → white | ||
| * | ||
| * Used by the Electron main process to set `BrowserWindow.backgroundColor` | ||
| * so resizing never flashes a mismatched color. | ||
| */ | ||
| export const THEME_BG_DARK = "#161616"; | ||
| export const THEME_BG_LIGHT = "#ffffff"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded colors duplicate CSS tokens risking driftLow Severity
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale background color when OS theme changes
Medium Severity
When the app is set to
"system"theme, OS-level dark/light mode changes update the renderer (viaprefers-color-schememedia query) but never callsetBackgroundColoron theBrowserWindow. TheSET_THEME_CHANNELhandler only fires when the user explicitly changes the theme in the UI. Without anativeTheme.on('updated')listener, the window background becomes stale after an OS theme change, causing the same wrong-color flash on resize that this PR aims to fix.Additional Locations (1)
apps/desktop/src/main.ts#L1230-L1233