popupMenu: Don't count the separator as an item when returning isEmpty

If we have a separator don't use it's possibly-unsynced visibility to
determine if the menu is empty or not.

https://bugzilla.gnome.org/show_bug.cgi?id=70386
This commit is contained in:
Michael Wood 2013-07-15 19:16:30 +01:00
parent cfecd063c9
commit 658db43ad3

View File

@ -722,6 +722,8 @@ const PopupMenuBase = new Lang.Class({
isEmpty: function() { isEmpty: function() {
let hasVisibleChildren = this.box.get_children().some(function(child) { let hasVisibleChildren = this.box.get_children().some(function(child) {
if (child._delegate instanceof PopupSeparatorMenuItem)
return false;
return child.visible; return child.visible;
}); });