This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Windows, Keyboard] Enqueue keyboard message #34222
Merged
auto-submit[bot] merged 10 commits intoflutter:mainfrom Jun 24, 2022
Merged
[Windows, Keyboard] Enqueue keyboard message #34222auto-submit[bot] merged 10 commits intoflutter:mainfrom
auto-submit[bot] merged 10 commits intoflutter:mainfrom
Conversation
gspencergoog
approved these changes
Jun 24, 2022
| clear_key_calls(); | ||
| } | ||
|
|
||
| TEST(KeyboardTest, DisorderlyRespondedEvents) { |
Contributor
There was a problem hiding this comment.
Wouldn't you still want to test that events that used to arrive before the framework response no longer do? Or are the other test changes sufficient to guarantee that?
Contributor
Author
There was a problem hiding this comment.
Other test changes are sufficient to guarantee that even when the platform messages arrive too fast for the framework to handle, nothing will be responded out of order and the events turn out to be normal, such as here.
Co-authored-by: Greg Spencer <[email protected]>
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 25, 2022
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 PR changes how Win32 processes keyboard messages. The messages are now put into a queue, and the next message will not be processed at all until the previous message has been responded by the framework (or if the message does not need a response, such as a single
WM_CHAR).This fixes a racing condition described in flutter/flutter#82673 (comment). A similar strategy has been applied to macOS in #32120.
A previous attempt, #31379, alleviates the problem but failed to handle more complex scenarios.
A few unit tests have to be altered. Previously later key events will be dispatched before the framework responds to the first event. Now they will only be dispatched after the response. No perceptive changes are made.
A unit test "DisorderlyRespondedEvents" is removed, because it will no longer happen. Events will always be responded in order.
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.