From 52253625b84e9f6c6df7a581f307c1590c76ef72 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 16 Nov 2022 11:42:46 +0100 Subject: [PATCH] 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: --- js/ui/keyboard.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 7e40f62af..78c024524 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -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),