inputMethod: Check that there is an existing cursor location

Commit 17d9ec5788 made the input method call update() more eagerly,
but also at times that it does not have a cursor position yet. Make
it bail out correctly in that situation.

Fixes: 17d9ec5788 ("inputMethod: Keep Capabilite.FOCUS before context.focus_in/focus_out")
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2876>
This commit is contained in:
Carlos Garnacho 2023-08-09 11:47:28 +02:00
parent c9741ae3d5
commit 5e36a06835

View File

@ -380,9 +380,11 @@ export const InputMethod = GObject.registerClass({
return;
this._updateCapabilities();
this._context.set_content_type(this._purpose, this._hints);
this._context.set_cursor_location(
this._cursorRect.x, this._cursorRect.y,
this._cursorRect.width, this._cursorRect.height);
if (this._cursorRect) {
this._context.set_cursor_location(
this._cursorRect.x, this._cursorRect.y,
this._cursorRect.width, this._cursorRect.height);
}
this._emitRequestSurrounding();
}
});