fix(windows): sync Flutter render surface after SetBounds#582
Open
kaes1a wants to merge 1 commit intoleanflutter:mainfrom
Open
fix(windows): sync Flutter render surface after SetBounds#582kaes1a wants to merge 1 commit intoleanflutter:mainfrom
kaes1a wants to merge 1 commit intoleanflutter:mainfrom
Conversation
Call ForceChildRefresh() after SetWindowPos() in SetBounds() to ensure the Flutter render surface is properly synchronized with the new window size. Problem: When using setSize() or setBounds() to resize the window during app startup, Flutter's render surface may not sync correctly with the new window dimensions. This causes visual artifacts including: - Black areas appearing at window edges - UI elements rendered at incorrect positions - Click events working correctly while visuals are misaligned Root cause: SetWindowPos() triggers WM_SIZE which updates Flutter's logical coordinate system, but the physical render surface viewport may not update in time before the next frame is rendered. Solution: ForceChildRefresh() uses the +1px/-1px resize trick to force the Flutter view child window to fully synchronize its render surface. This is the same mechanism already used for WM_DPICHANGED and leave-full-screen scenarios. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: kaes1a <leehncg@gmail.com>
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.
Call ForceChildRefresh() after SetWindowPos() in SetBounds() to ensure the Flutter render surface is properly synchronized with the new window size.
Problem:
When using setSize() or setBounds() to resize the window during app startup, Flutter's render surface may not sync correctly with the new window dimensions. This causes visual artifacts including:
Root cause:
SetWindowPos() triggers WM_SIZE which updates Flutter's logical coordinate system, but the physical render surface viewport may not update in time before the next frame is rendered.
Solution:
ForceChildRefresh() uses the +1px/-1px resize trick to force the Flutter view child window to fully synchronize its render surface. This is the same mechanism already used for WM_DPICHANGED and leave-full-screen scenarios.