From c6d2f7d6c4442beaa3d743be2efbdcbd02409f81 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 26 Jan 2024 20:22:14 +0100 Subject: [PATCH] keyboard: Simplify group change emission at KeyboardController Since we now just store the current group, we do not need to track closely source changes vs selection changes in the available sources. We just re-generate the current OSK keymap for all, so coalesce both signals into a more generic "group-changed". Part-of: --- js/ui/keyboard.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 423aeef23..c7f244b02 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1335,8 +1335,7 @@ export const Keyboard = GObject.registerClass({ this._updateKeys(); this._keyboardController.connectObject( - 'active-group', this._onGroupChanged.bind(this), - 'groups-changed', this._onKeyboardGroupsChanged.bind(this), + 'group-changed', this._onGroupChanged.bind(this), 'panel-state', this._onKeyboardStateChanged.bind(this), 'purpose-changed', this._onPurposeChanged.bind(this), this); @@ -1755,10 +1754,6 @@ export const Keyboard = GObject.registerClass({ this._updateKeys(); } - _onKeyboardGroupsChanged() { - this._onGroupChanged(); - } - _onKeyboardStateChanged(controller, state) { let enabled; if (state === Clutter.InputPanelState.OFF) @@ -2101,13 +2096,13 @@ class KeyboardController extends Signals.EventEmitter { } _onSourcesModified() { - this.emit('groups-changed'); + this.emit('group-changed'); } _onSourceChanged(inputSourceManager, _oldSource) { let source = inputSourceManager.currentSource; this._currentSource = source; - this.emit('active-group', source.id); + this.emit('group-changed'); } _onContentPurposeHintsChanged(method) {