popupMenu: Avoid open state reentrancy in dummy menus

Dummy menus may emit ::open-state-changed multiple times for
the same state. Avoid doing that so that the PopupMenuManager
is happy not having to handle reentrancy.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5064
(cherry picked from commit 89db7bbb12)

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2181>
This commit is contained in:
Carlos Garnacho 2022-02-13 14:05:41 +01:00 committed by Florian Müllner
parent 8773ad7442
commit 4cccc972f7

View file

@ -998,10 +998,16 @@ var PopupDummyMenu = class {
}
open() {
if (this.isOpen)
return;
this.isOpen = true;
this.emit('open-state-changed', true);
}
close() {
if (!this.isOpen)
return;
this.isOpen = false;
this.emit('open-state-changed', false);
}