fix(text-input): a disable ends the composition like a leave
The window's record of the composing text it was last told (TextStrings().shown) was cleared only by the compositor's leave. An app that disables and enables the text input to reset the input method — after it committed the composing word itself — then never heard of a later composition equal to that word: the done handler reports a preedit only when it differs from the record. The disable path clears the record and the pending flags now, as the leave does, so the first composition after an enable is reported whatever it is.
This commit is contained in:
parent
852ae8abe3
commit
6f471ca6b1
1 changed files with 6 additions and 0 deletions
|
|
@ -455,6 +455,12 @@ void Device::ApplyTextInput(Window* window) {
|
||||||
if (!window->textInputEnabled_) return;
|
if (!window->textInputEnabled_) return;
|
||||||
window->textInputEnabled_ = false;
|
window->textInputEnabled_ = false;
|
||||||
zwp_text_input_v3_disable(textInput);
|
zwp_text_input_v3_disable(textInput);
|
||||||
|
// The disable ends the composition as a leave does: the next enable
|
||||||
|
// starts afresh, so the record of what the window was last told goes
|
||||||
|
// with it (a composition equal to it after the enable is new).
|
||||||
|
textInputHasPreedit = textInputHasCommit = textInputHasDelete = false;
|
||||||
|
TextStrings().preedit.clear();
|
||||||
|
TextStrings().shown.clear();
|
||||||
}
|
}
|
||||||
zwp_text_input_v3_commit(textInput);
|
zwp_text_input_v3_commit(textInput);
|
||||||
wl_display_flush(display);
|
wl_display_flush(display);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue