From 290dd38a3af211f82b71aaab74dee0d4302855e2 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 17 Oct 2022 13:29:10 +0200 Subject: [PATCH] ibusManager: Allow passing callbacks after enabling/disabling completion Since this is an async operation, we may want to let some things happen after the engine is changed due to completion being enabled/disabled. Part-of: --- js/misc/ibusManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/misc/ibusManager.js b/js/misc/ibusManager.js index ebab179a2..5ba7e636d 100644 --- a/js/misc/ibusManager.js +++ b/js/misc/ibusManager.js @@ -337,7 +337,7 @@ var IBusManager = class extends Signals.EventEmitter { }); } - setCompletionEnabled(enabled) { + setCompletionEnabled(enabled, callback) { /* Needs typing-booster available */ if (!this._engines.has(TYPING_BOOSTER_ENGINE)) return false; @@ -373,12 +373,12 @@ var IBusManager = class extends Signals.EventEmitter { settings.reset(KEY_INLINECOMPLETION); settings.set_string(KEY_INPUTMETHOD, 'NoIME'); - this.setEngine(TYPING_BOOSTER_ENGINE); + this.setEngine(TYPING_BOOSTER_ENGINE, callback); } else if (this._preOskState) { const {engine, emoji, langs, completion, inputMethod} = this._preOskState; this._preOskState = null; - this.setEngine(engine); + this.setEngine(engine, callback); settings.set_value(KEY_EMOJIPREDICTIONS, emoji); settings.set_value(KEY_DICTIONARY, langs); settings.set_value(KEY_INLINECOMPLETION, completion);