mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
inputMethod: Make set_surrounding() send also empty string
Empty surrounding text values needs to be sent to IBus engines so that the engines know the focus is changed and the values are updated. Also InputMethod can forward the "require-surrounding-text" signal from IBus engine to mutter. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5895 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2496>
This commit is contained in:
parent
7d7b99e2d3
commit
f4dc650585
1 changed files with 6 additions and 1 deletions
|
|
@ -76,6 +76,7 @@ var InputMethod = GObject.registerClass({
|
|||
|
||||
this._context.set_client_commit_preedit(true);
|
||||
this._context.connect('commit-text', this._onCommitText.bind(this));
|
||||
this._context.connect('require-surrounding-text', this._onRequireSurroundingText.bind(this));
|
||||
this._context.connect('delete-surrounding-text', this._onDeleteSurroundingText.bind(this));
|
||||
this._context.connect('update-preedit-text-with-mode', this._onUpdatePreeditText.bind(this));
|
||||
this._context.connect('show-preedit-text', this._onShowPreeditText.bind(this));
|
||||
|
|
@ -114,6 +115,10 @@ var InputMethod = GObject.registerClass({
|
|||
this.commit(text.get_text());
|
||||
}
|
||||
|
||||
_onRequireSurroundingText(_context) {
|
||||
this.request_surrounding();
|
||||
}
|
||||
|
||||
_onDeleteSurroundingText(_context, offset, nchars) {
|
||||
try {
|
||||
this.delete_surrounding(offset, nchars);
|
||||
|
|
@ -235,7 +240,7 @@ var InputMethod = GObject.registerClass({
|
|||
this._surroundingTextCursor = cursor;
|
||||
this.emit('surrounding-text-set');
|
||||
|
||||
if (!this._context || !text)
|
||||
if (!this._context || (!text && text !== ''))
|
||||
return;
|
||||
|
||||
let ibusText = IBus.Text.new_from_string(text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue