From 89db7bbb120b5874bd94cdeb1992712513281b26 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sun, 13 Feb 2022 14:05:41 +0100 Subject: [PATCH] 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 Part-of: --- js/ui/popupMenu.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index f30c01146..5908f7a29 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -994,10 +994,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); }