[gnome-shell] keyboard: Unset Idle ID before removing it



commit 2702a82896ab38d044a231b4387f8f5ab48d984f
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Thu May 9 14:51:17 2019 -0500

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]