[gnome-shell/wip/carlosg/dummy-menu-reentrancy: 3/3] popupMenu: Avoid open state reentrancy in dummy menus
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/carlosg/dummy-menu-reentrancy: 3/3] popupMenu: Avoid open state reentrancy in dummy menus
- Date: Sun, 13 Feb 2022 13:25:45 +0000 (UTC)
commit 89db7bbb120b5874bd94cdeb1992712513281b26
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Feb 13 14:05:41 2022 +0100
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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2178>
js/ui/popupMenu.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index f30c011468..5908f7a295 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]