From 2ed28211ed8904e1f926020e5273bd2494770315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 6 Sep 2012 11:43:02 +0200 Subject: [PATCH] popupMenu: Don't always ignore SubMenu children in width requests Hidden children are currently ignored in width requests; in the case of submenu items, this results in abrupt width changes of open menus when the corresponding SubMenuMenuItem is toggled. To fix, only ignore SubMenu children when the corresponding SubMenuMenuItem is hidden as well. https://bugzilla.gnome.org/show_bug.cgi?id=683485 --- js/ui/popupMenu.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 5f8b999c2..28be350da 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -1100,7 +1100,8 @@ const PopupMenuBase = new Lang.Class({ let columnWidths = []; let items = this.box.get_children(); for (let i = 0; i < items.length; i++) { - if (!items[i].visible) + if (!items[i].visible && + !(items[i]._delegate instanceof PopupSubMenu && items[i-1].visible)) continue; if (items[i]._delegate instanceof PopupBaseMenuItem || items[i]._delegate instanceof PopupMenuBase) { let itemColumnWidths = items[i]._delegate.getColumnWidths();