-
Notifications
You must be signed in to change notification settings - Fork 6k
[macOS] Forward key events to NSTextInputContext when there's composing text #32051
[macOS] Forward key events to NSTextInputContext when there's composing text #32051
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[tester recordEmbedderCallsTo:embedderCallbacks]; | ||
[tester recordChannelCallsTo:channelCallbacks]; | ||
// TextInputPlugin does not claim the event. | ||
[tester respondTextInputWith:NO]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is used to set the responses from the mocked TextInputPlugin, not to check. (Maybe I should add a method to check its value...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I didn't mean to use this as a "verification" statement. The verification step is at line 385 & 386 where we make sure the event doesn't go to the primary responder(s) even with text input not claiming the key event for itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah so this line does little and should be removed. And still we haven't ensured that onTextInputKeyEvent
is called.
// TextInputPlugin does not claim the event. | ||
[tester respondTextInputWith:NO]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TextInputPlugin does not claim the event. | |
[tester respondTextInputWith:NO]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or can you create a way for the mocked text input plugin to record the events, just like the embedder and channel ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure ideally I want to verify that the text input plugin did get the event.
|
||
// Send another down event with composing == NO. | ||
tester.isComposing = NO; | ||
[tester respondTextInputWith:YES]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[tester respondTextInputWith:YES]; |
Also, why is this not a long-term fix? I thought this was the only way to fix it. |
This pull request is not suitable for automatic merging in its current state.
|
macOS has all kinds of popovers that can be displayed during text input and should receive key events when visible, the IME candidate window is just one of them (other examples, the accent menu or the emoji menu). |
ea4d76c
to
f9247e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* 9f13454 [windows] Support win_debug_x86 compilation target in engine (flutter/engine#30417) * c5e958e Make tracing safe (flutter/engine#32042) * cf875d4 [macOS] Forward key events to NSTextInputContext when there's composing text (flutter/engine#32051) * ffd5c9c Roll Fuchsia Linux SDK from Ee9OX2o6P... to mVqiTwaVa... (flutter/engine#32055) * b0018c3 Roll Skia from a9bc6c643791 to 8afe53fd76d3 (1 revision) (flutter/engine#32056) * df12321 Roll Skia from 8afe53fd76d3 to 0d81bc7bb04e (2 revisions) (flutter/engine#32057) * 398a274 Roll Fuchsia Mac SDK from jvlI1s78T... to vWlaMIVkM... (flutter/engine#32060) * 3ffa9cf Roll Skia from 0d81bc7bb04e to e253cc3e55d3 (1 revision) (flutter/engine#32063) * 275cd2b [web] Position spans absolutely within paragraph (flutter/engine#31907) * 46c2cca Roll Skia from e253cc3e55d3 to 9301fe3779bb (1 revision) (flutter/engine#32064)
Partially fixes flutter/flutter#85328, still does not work in the macOS accent menu
Quick demo:
Screen.Recording.2022-03-15.at.3.47.43.PM.mov
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.