diff --git a/js/ui/layout.js b/js/ui/layout.js index 744a8f119..1441bfe0a 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -189,6 +189,7 @@ var LayoutManager = GObject.registerClass({ 'startup-complete': {}, 'startup-prepared': {}, 'monitors-changed': {}, + 'system-modal-opened': {}, 'keyboard-visible-changed': { param_types: [GObject.TYPE_BOOLEAN] } }, }, class LayoutManager extends GObject.Object { _init() { diff --git a/js/ui/modalDialog.js b/js/ui/modalDialog.js index 1eeb15a95..64d02001b 100644 --- a/js/ui/modalDialog.js +++ b/js/ui/modalDialog.js @@ -216,6 +216,8 @@ var ModalDialog = GObject.registerClass({ if (!Main.pushModal(this, params)) return false; + Main.layoutManager.emit('system-modal-opened'); + this._hasModal = true; if (this._savedKeyFocus) { this._savedKeyFocus.grab_key_focus(); diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index 96c85df38..693a415a0 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -46,6 +46,9 @@ var SwitcherPopup = GObject.registerClass({ Main.uiGroup.add_actor(this); + this._systemModalOpenedId = + Main.layoutManager.connect('system-modal-opened', () => this.destroy()); + this._haveModal = false; this._modifierMask = 0; @@ -312,6 +315,8 @@ var SwitcherPopup = GObject.registerClass({ _onDestroy() { this._popModal(); + Main.layoutManager.disconnect(this._systemModalOpenedId); + if (this._motionTimeoutId != 0) GLib.source_remove(this._motionTimeoutId); if (this._initialDelayTimeoutId != 0)