Repository navigation
Fix transient stale layouts during window rotation - #68
Merged
Merged
Conversation
Window metrics can change orientation after Compose has already laid out the current frame. Track that transition until pre-draw, including changes first observed during global layout, and cancel the stale drawing pass after sending pending snapshot apply notifications so the next frame can recompose. Restrict draw cancellation to orientation changes to preserve drawing during same-orientation resizing. Route refresh and reattachment through the same size update method, and clear the pending draw flag when observation stops. Validation: - Adaptive-window Android compilation and SPA Official Debug/Release builds passed, including the release R8 reflection check. - Without a debugger, actual draw diagnostics passed 20 rotations on API 30, 10 on API 31, and 20 on API 32 after the original API 31 build reproduced stale-layout draws on all six observed rotations. - View/ComposeView reattachment, zero-sized initialization, context rebasing, and the existing controlled delayed-metrics recovery paths passed. - Fold/unfold and resize checks passed 43 final native-window size assertions. - SPA playback recordings no longer showed the transient tiny-cover layout seen before this change. Huawei Mate 40 Pro hardware verification is pending.
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.
Rotating a window can draw the previous adaptive layout in the new window bounds before Compose recomposes. In SPA, the cover briefly shrinks or disappears before the player settles into the correct layout. This follows up on #66.
Record native window orientation changes until pre-draw, send pending snapshot apply notifications, and cancel that drawing pass so the next frame can recompose. The flag also covers changes first observed during global layout. Limit cancellation to orientation changes, and clear it when observation stops. The native size source and API < 33 compatibility scope remain the same.
Validation
Runtime checks used temporary diagnostics outside tracked source. Confirmation on the reported Huawei Mate 40 Pro/EMUI 13 device is still pending.