mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
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
This commit is contained in:
parent
c0309d9732
commit
ccd8b47d30
1 changed files with 11 additions and 0 deletions
|
|
@ -817,6 +817,7 @@ var PopupMenu = class extends PopupMenuBase {
|
|||
this._onKeyPress.bind(this));
|
||||
}
|
||||
|
||||
this._systemModalOpenedId = 0;
|
||||
this._openedSubMenu = null;
|
||||
}
|
||||
|
||||
|
|
@ -891,6 +892,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);
|
||||
|
|
@ -921,6 +927,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();
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue