This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[WIP] Investigate keyboard state sync on Windows #50761
Closed
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.
Description
This is a WIP PR to evaluate how #44827 can help to find a solution for flutter/flutter#125975.
This PR makes it a little more difficult to reproduce flutter/flutter#125975 but unfortunately, it does not fix the issue fully.
From my local experimentation, it seems that, with this PR, the engine key pressed state can be updated just after the framework queried the state and before the framework registered key channel handlers (this leads to framework and engine key pressed state being different).
My guess is that this happens because of the async call on the framework side:
See https://github.com/flutter/flutter/blob/74e054f04ae59cd9e721710f183f53897b3c9ded/packages/flutter/lib/src/services/binding.dart#L83-L86
Related Issue
Related flutter/flutter#125975
Tests
WIP only