diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index d2a8dd59c..b3de70b9a 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -75,6 +75,7 @@ const Key = new Lang.Class({ _init : function(key) { this._key = key; this.actor = this._makeKey(key, GLib.markup_escape_text(key.label, -1)); + this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); this._extended_keys = this._key.get_extended_keys(); this._extended_keyboard = null; @@ -97,6 +98,13 @@ const Key = new Lang.Class({ } }, + _onDestroy: function() { + if (this._boxPointer) { + this._boxPointer.actor.destroy(); + this._boxPointer = null; + } + }, + _makeKey: function (key, label) { let button = new St.Button ({ label: label, style_class: 'keyboard-key' });