keyboard: Disconnect from InputMethod::terminal-mode-changed on destruction

The OSK may be created and destroyed, while it connects to signals from the
longer-lived InputMethod object. This makes these signals linger and issue
copious warnings while trying to change the extended keymap and new ratio
on a defunct OSK.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6085
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2543>
This commit is contained in:
Carlos Garnacho 2022-11-16 11:42:46 +01:00 committed by Marge Bot
parent a0352ba312
commit 52253625b8

View File

@ -1430,8 +1430,9 @@ var Keyboard = GObject.registerClass({
this._ensureKeysForGroup(this._keyboardController.getCurrentGroup());
this._setActiveLayer(0);
Main.inputMethod.connect(
'terminal-mode-changed', this._onTerminalModeChanged.bind(this));
Main.inputMethod.connectObject(
'terminal-mode-changed', this._onTerminalModeChanged.bind(this),
this);
this._keyboardController.connectObject(
'active-group', this._onGroupChanged.bind(this),