[gnome-shell/gnome-3-34] popupMenu: Close when a system modal pops up
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-34] popupMenu: Close when a system modal pops up
- Date: Wed, 11 Dec 2019 21:40:08 +0000 (UTC)
commit afd2ce2353092c6e28e9465eaec13ee531a72994
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Dec 6 18:07:35 2019 +0100
popupMenu: Close when a system modal pops up
Just like switcher popups, popup menus don't play well together with
system modals, and generally have a lower priority. So just like
switcher popups, close popup menus when a system modal dialog pops
up.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1536
js/ui/popupMenu.js | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 49ed823b12..b5eb9928af 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -804,6 +804,7 @@ var PopupMenu = class extends PopupMenuBase {
this._keyPressId = this.sourceActor.connect('key-press-event',
this._onKeyPress.bind(this));
+ this._systemModalOpenedId = 0;
this._openedSubMenu = null;
}
@@ -878,6 +879,11 @@ var PopupMenu = class extends PopupMenuBase {
if (this.isEmpty())
return;
+ if (!this._systemModalOpenedId) {
+ this._systemModalOpenedId =
+ Main.layoutManager.connect('system-modal-opened', () => this.close());
+ }
+
this.isOpen = true;
this._boxPointer.setPosition(this.sourceActor, this._arrowAlignment);
@@ -908,6 +914,11 @@ var PopupMenu = class extends PopupMenuBase {
destroy() {
if (this._keyPressId)
this.sourceActor.disconnect(this._keyPressId);
+
+ if (this._systemModalOpenedId)
+ Main.layoutManager.disconnect(this._systemModalOpenedId);
+ this._systemModalOpenedId = 0;
+
super.destroy();
}
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]