From 924b31233bbcea2980febb776b947142a6559d8d Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 25 Mar 2011 10:14:55 -0400 Subject: [PATCH] popupMenu: fix relayout after submenu open/close Because of the GtkSizeGroup-like trickiness we're doing with PopupMenuItems, we need to force Clutter to discard its cached size requests for them any time the menu itself changes size. https://bugzilla.gnome.org/show_bug.cgi?id=645647 --- js/ui/popupMenu.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 97a9c4d7f..fc6140569 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -765,6 +765,7 @@ PopupMenuBase.prototype = { } else { this.box = new St.BoxLayout({ vertical: true }); } + this.box.connect_after('queue-relayout', Lang.bind(this, this._menuQueueRelayout)); this.isOpen = false; @@ -893,6 +894,16 @@ PopupMenuBase.prototype = { } }, + // Because of the above column-width funniness, we need to do a + // queue-relayout on every item whenever the menu itself changes + // size, to force clutter to drop its cached size requests. (The + // menuitems will in turn call queue_relayout on their parent, the + // menu, but that call will be a no-op since the menu already + // has a relayout queued, so we won't get stuck in a loop. + _menuQueueRelayout: function() { + this.box.get_children().map(function (actor) { actor.queue_relayout(); }); + }, + addActor: function(actor) { this.box.add(actor); },