This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Reland "Avoid vsync scheduling delay" #36197
Merged
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.
Relands #34363 which was reverted in #36091 with fix.
Fix flutter/flutter#110867. The fix is in 6cf5494; the parent commit is a pure revert of the revert.
Explanation of flutter/flutter#110867
Some user might write Dart code like the following to keep the app in full screen mode even after this might be changed in response to certain user actions. There is no built in time out or gesture that will restore the full screen mode the app was in. (Thanks to @Piinks for helping me understand this offline)
This is what happens:
OnSystemUiVisibilityChangeListenerreceives a notification of the changesetSystemUIChangeCallback(above) is calledSystemChrome.restoreSystemUIOverlays()is called in the callback, sending a platform message to the hostsetSystemUiVisibility.1-5 all occur in the same frame. Because of this,
OnSystemUiVisibilityChangeListenerwill silently stop responding to future system UI notifications.#34363 introduces the behaviour in bold; previously using
new Handlerinstead ofHandler.createAsyncwill always cause platform messages to be scheduled in the next frame, such as in (5).This PR causes (3) to be scheduled in a subsequent frame, avoiding the issue.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on [Discord].