inputMethod: Equate empty preedit string to null

If we get '' from the IM as the preedit string, it is pretty safe
to handle it as "no preedit" altogether.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2011>
This commit is contained in:
Carlos Garnacho 2021-10-29 16:41:55 +02:00 committed by Marge Bot
parent b93342f72e
commit 286cfdc6d4

View File

@ -111,6 +111,8 @@ class InputMethod extends Clutter.InputMethod {
return; return;
let preedit = text.get_text(); let preedit = text.get_text();
if (preedit === '')
preedit = null;
if (visible) if (visible)
this.set_preedit_text(preedit, pos, mode); this.set_preedit_text(preedit, pos, mode);