From 2702a82896ab38d044a231b4387f8f5ab48d984f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 9 May 2019 14:51:17 -0500 Subject: [PATCH] keyboard: Unset Idle ID before removing it When toggling keyboard various times, we might get an error because trying to disconnect an idle that isn't set anymore. This is because when we remove the idle, we don't unset the ID. Also clear the idle when destroying the keyboard. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/540 --- js/ui/keyboard.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 6d4585de8..df2e3ed2f 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -1144,6 +1144,7 @@ var Keyboard = class Keyboard { this._keyboardController.disconnect(this._keypadVisibleId); if (this._focusNotifyId) global.stage.disconnect(this._focusNotifyId); + this._clearShowIdle(); this._keyboard = null; this.actor.destroy(); this.actor = null; @@ -1229,6 +1230,7 @@ var Keyboard = class Keyboard { if (!this._showIdleId) { this._showIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { this.show(Main.layoutManager.focusIndex); + this._showIdleId = 0; return GLib.SOURCE_REMOVE; }); GLib.Source.set_name_by_id(this._showIdleId, '[gnome-shell] this.show');