ibusManager: Use async await instead of callbacks

Code that uses async/await is often easier to follow than callbacks, in
particular as part of the code is already async.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3439>
This commit is contained in:
Sundeep Mediratta
2024-08-01 19:18:33 -04:00
committed by Florian Müllner
parent 8af1a1dfb9
commit ce89b15bb1
3 changed files with 20 additions and 20 deletions

View File

@ -495,7 +495,7 @@ export class InputSourceManager extends Signals.EventEmitter {
this._changePerWindowSource();
}
activateInputSource(is, interactive) {
async activateInputSource(is, interactive) {
// The focus changes during holdKeyboard/releaseKeyboard may trick
// the client into hiding UI containing the currently focused entry.
// So holdKeyboard/releaseKeyboard are not called when
@ -519,10 +519,10 @@ export class InputSourceManager extends Signals.EventEmitter {
else
engine = 'xkb:us::eng';
await this._ibusManager.setEngine(engine);
if (!this._reloading)
this._ibusManager.setEngine(engine, KeyboardManager.releaseKeyboard);
else
this._ibusManager.setEngine(engine);
KeyboardManager.releaseKeyboard();
this._currentInputSourceChanged(is);
if (interactive)