[gnome-shell] popupMenu: fix relayout after submenu open/close



commit 924b31233bbcea2980febb776b947142a6559d8d
Author: Dan Winship <danw gnome org>
Date:   Fri Mar 25 10:14:55 2011 -0400

    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 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 97a9c4d..fc61405 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);
     },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]