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
This commit is contained in:
Marco Trevisan (Treviño) 2019-05-09 14:51:17 -05:00
parent 8ad33d8752
commit 2702a82896

View File

@ -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');