inputMethod: Fix setting surrounding text

The underlying ibus method expects an object of type IBusText rather
than a plain string.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/228
This commit is contained in:
Florian Müllner 2018-09-11 15:36:35 +02:00 committed by Florian Müllner
parent 361955dbf9
commit a35382d6fc

View File

@ -176,8 +176,11 @@ var InputMethod = new Lang.Class({
},
vfunc_set_surrounding(text, cursor, anchor) {
if (this._context && text)
this._context.set_surrounding_text(text, cursor, anchor);
if (!this._context || !text)
return;
let ibusText = IBus.Text.new_from_string(text);
this._context.set_surrounding_text(ibusText, cursor, anchor);
},
vfunc_update_content_hints(hints) {