Synchronization is only needed for 3 things:
- to let the input method know when its update was applied not like it expected,
- especially when a byte index stopped being on bytes boundary due to extra change and a retry is needed,
- to break off events coming to an old text input after focusing a new one.
The one big change of this is relaxing the contract of the input method. The application now doesn't apply the changes exactly.
"delete_surrounding_text" is the only affected place so far, now it mentions the unexactness explicitly. The change is necessary because without strict sync, the input method can't know if it's sending messages aligned on code point boundaries.
This solves 90% of the retry problem.
Such problems all stem from text changing near the caret, where the user already has an expectation of weird interactions (multi-user typing over each other - IME garbage in, text garbage out), or the user expects something that the input method can't correct (text to emoji substitution should not result in a retry due to unexpected output, making this work with IME is the client's problem).
The other big change is keeping sync for the purpose of switching text fields.
Hopefully this is enough for everyone, and it stays more or less compatible.
Signed-off-by: Dorota Czaplejewicz <gilapfco.dcz@porcupinefactory.org>
This update solves the mobile problem of the "enter" key.
It also makes precise cursor placement possible from the IME.
Signed-off-by: Dorota Czaplejewicz
The original MR did not copy the popup interface because it's been limited and inadequate for actual use.
This introduces a version heavily based on xdg-popup.
Signed-off-by: Dorota Czaplejewicz
This change strips down the protocol to functionality that corresponds
to text-input-v3, is already useful, typically implemented in the wild
(squeekboard), and well-understood.
Dificult to implement well functionality like keyboard grabs is removed
to find a better solution without stopping the development of the basic
functionality.
Signed-off-by: Dorota Czaplejewicz
This is a separate commit so that it's clear the base for this protocol
was just a copy with no changes.
It also includes the protocol in the build system.
Signed-off-by: Dorota Czaplejewicz
This commit introduces an experimental input-method protocol as an exact
copy of the fle describing the unofficial zwp_input_method_v2 from
squeekboard.
It's also supported by wlroots and smithay.
This protocol is the counterpart to text-input-v3. It gives the
compositor a standard way to outsource the handling of the input method.
Signed-off-by: Dorota Czaplejewicz