diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index fa6ddad8d..aca4ae3de 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -870,6 +870,10 @@ const PopupMenuBase = new Lang.Class({ return menuItem; }, + isEmpty: function() { + return this.box.get_children().length == 0; + }, + isChildMenu: function(menu) { return this._childMenus.indexOf(menu) != -1; }, @@ -1195,6 +1199,9 @@ const PopupMenu = new Lang.Class({ if (this.isOpen) return; + if (this.isEmpty()) + return; + this.isOpen = true; this._boxPointer.setPosition(this.sourceActor, this._arrowAlignment); @@ -1286,6 +1293,9 @@ const PopupSubMenu = new Lang.Class({ if (this.isOpen) return; + if (this.isEmpty()) + return; + this.isOpen = true; this.actor.show(); @@ -1530,6 +1540,9 @@ const PopupComboMenu = new Lang.Class({ if (this.isOpen) return; + if (this.isEmpty()) + return; + this.isOpen = true; let [sourceX, sourceY] = this.sourceActor.get_transformed_position();