Chromium Code Reviews
DescriptionStraighten up input method reactivation
On Android, if you move focus from one input form to another, and type a
word immediately, then sometimes the original text gets duplicated.
The reason is that currently onCreateInputConnection() provides incorrect
initial sel start and initial sel end values, and this ended up confusing
the keyboard.
The changes here include:
1) Ignore IME-initiated operations until restart input gets ACKed.
Otherwise, IME operations targeted for the previous input form get applied
to the next input form.
This apply both to cancel composition and focused node change scenarios.
For the deprecating ReplicaInputConnection model, we ignored IME-initiated
operations whenever there was renderer-initiated conflict. We dropped the
logic for ThreadedInputConnection model, but I think it’s useful when
we have to restart input, so partially reviving the logic.
2) Defer cancel composition and focused node changed messages.
When CancelComposition and FocusedNodeChanged messages are sent in the
middle of IME event guard, input method may see an outdated text input
state when restarting input method. We queue the messages and send them
at once after UpdateTextInputState() is finished.
An alternative approach would be to call focusedNodeChanged after visible
selection becomes available, but I couldn't find a way so far.
3) Update text input state when IME event guard finishes.
Currently only Android does this. Extend the logic to other platforms in
order to implement 2) without adding OS_ANDROID imperatives.
BUG=650204
Patch Set 1 #Patch Set 2 : fix some tests #Messages
Total messages: 9 (9 generated)
|