Skip to content

Add configurable clearColor to SkiaLayer to avoid white background during resize on Windows.#1042

Open
bezsahara wants to merge 1 commit intoJetBrains:masterfrom
bezsahara:master
Open

Add configurable clearColor to SkiaLayer to avoid white background during resize on Windows.#1042
bezsahara wants to merge 1 commit intoJetBrains:masterfrom
bezsahara:master

Conversation

@bezsahara
Copy link
Copy Markdown

This adds a clearColor field to SkiaLayer, supported by a new SkiaLayerProperties.clearColor value.
It defaults to white but can be overridden via a system property (SKIKO_CLEAR_COLOR) or by setting SkiaLayerProperties.defaultClearColor early at startup.

This helps eliminate the white flicker during window resizing in Compose Desktop (observed on Windows).
The change is fully backward-compatible and has no effect unless explicitly configured.

I’ve tested it, and the white background disappears completely. Here are links to issues on YouTrack that describe the issue:
https://youtrack.jetbrains.com/issue/CMP-7700/Desktop-Synchronize-Compose-and-Swing-layout-and-rendering-phases
https://youtrack.jetbrains.com/issue/CMP-7919/White-background-flicker-during-window-resize-in-Compose-Desktop

…erProperties.clearColor value.

It defaults to white but can be overridden via system property (SKIKO_CLEAR_COLOR) or by modifying SkiaLayerProperties.defaultClearColor early in startup.
This is useful for fixing white flicker during resize in Compose Desktop (observed on Windows), especially in dark-themed apps.
The change is fully backward-compatible and does not impact behavior unless explicitly configured.
@MatkovIvan MatkovIvan requested a review from m-sasha April 14, 2025 09:55
@m-sasha
Copy link
Copy Markdown
Contributor

m-sasha commented Apr 14, 2025

I'm currently investigating the same issue on macOS, and after that I'll look into Windows as well.

@JonnyTsGitHub
Copy link
Copy Markdown

Please review and accept this PR. I need this as well.

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.

3 participants