Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

bleroux
Copy link
Contributor

@bleroux bleroux commented Feb 19, 2024

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:

    _keyboard.syncKeyboardState().then((_) {
      platformDispatcher.onKeyData = _keyEventManager.handleKeyData;
      SystemChannels.keyEvent.setMessageHandler(_keyEventManager.handleRawKeyMessage);
    });

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

@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

@chinmaygarde
Copy link
Member

Triage: Is this stale now?

@bleroux
Copy link
Contributor Author

bleroux commented Mar 8, 2024

Triage: Is this stale now?

Closing because this was an experimental PR I wanted to share with @dkwingsmt.

@bleroux bleroux closed this Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants