Add configurable clearColor to SkiaLayer to avoid white background during resize on Windows.#1042
Open
bezsahara wants to merge 1 commit intoJetBrains:masterfrom
Open
Add configurable clearColor to SkiaLayer to avoid white background during resize on Windows.#1042bezsahara wants to merge 1 commit intoJetBrains:masterfrom
bezsahara wants to merge 1 commit intoJetBrains:masterfrom
Conversation
…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.
Contributor
|
I'm currently investigating the same issue on macOS, and after that I'll look into Windows as well. |
|
Please review and accept this PR. I need this as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
clearColorfield toSkiaLayer, supported by a new SkiaLayerProperties.clearColor value.It defaults to white but can be overridden via a system property (
SKIKO_CLEAR_COLOR) or by settingSkiaLayerProperties.defaultClearColorearly 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