keyboard: Forward input purpose from KeyboardController
Instead of adding more emoji/keypad signals, forward the input purpose, so that in future commits the Keyboard object can figure out the right layout from the purpose hint. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
This commit is contained in:
parent
8673758336
commit
173d70dc70
@ -1421,6 +1421,7 @@ export const Keyboard = GObject.registerClass({
|
|||||||
'active-group', this._onGroupChanged.bind(this),
|
'active-group', this._onGroupChanged.bind(this),
|
||||||
'groups-changed', this._onKeyboardGroupsChanged.bind(this),
|
'groups-changed', this._onKeyboardGroupsChanged.bind(this),
|
||||||
'panel-state', this._onKeyboardStateChanged.bind(this),
|
'panel-state', this._onKeyboardStateChanged.bind(this),
|
||||||
|
'purpose-changed', this._onPurposeChanged.bind(this),
|
||||||
'keypad-visible', this._onKeypadVisible.bind(this),
|
'keypad-visible', this._onKeypadVisible.bind(this),
|
||||||
this);
|
this);
|
||||||
global.stage.connectObject('notify::key-focus',
|
global.stage.connectObject('notify::key-focus',
|
||||||
@ -1434,6 +1435,11 @@ export const Keyboard = GObject.registerClass({
|
|||||||
this._relayout();
|
this._relayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onPurposeChanged(controller, purpose) {
|
||||||
|
this._purpose = purpose;
|
||||||
|
this._updateKeys();
|
||||||
|
}
|
||||||
|
|
||||||
_onKeyFocusChanged() {
|
_onKeyFocusChanged() {
|
||||||
let focus = global.stage.key_focus;
|
let focus = global.stage.key_focus;
|
||||||
|
|
||||||
@ -2198,6 +2204,7 @@ class KeyboardController extends Signals.EventEmitter {
|
|||||||
|
|
||||||
this.emit('emoji-visible', emojiVisible);
|
this.emit('emoji-visible', emojiVisible);
|
||||||
this.emit('keypad-visible', keypadVisible);
|
this.emit('keypad-visible', keypadVisible);
|
||||||
|
this.emit('purpose-changed', purpose);
|
||||||
}
|
}
|
||||||
|
|
||||||
getGroups() {
|
getGroups() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user