[gnome-shell/wip/aggregate-menu: 14/59] popupMenu: Don't animate submenus closing when closing the menu



commit 5b933b70105e6b257c97fa9aaf267657c1f316a3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 11 18:33:30 2013 -0400

    popupMenu: Don't animate submenus closing when closing the menu
    
    It looks distracting.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702539

 js/ui/popupMenu.js |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index c025b02..1daf200 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -859,10 +859,14 @@ const PopupMenuBase = new Lang.Class({
                     else
                         menuItem.close();
                 });
+            menuItem._parentClosingId = this.connect('menu-closed', function() {
+                menuItem.emit('menu-closed');
+            });
             menuItem.connect('destroy', Lang.bind(this, function() {
                 menuItem.disconnect(menuItem._subMenuActivateId);
                 menuItem.disconnect(menuItem._subMenuActiveChangeId);
                 this.disconnect(menuItem._parentOpenStateChangedId);
+                this.disconnect(menuItem._parentClosingId);
 
                 this.length--;
             }));
@@ -873,9 +877,8 @@ const PopupMenuBase = new Lang.Class({
                 this.box.insert_child_below(menuItem.menu.actor, before_item);
             this._connectSubMenuSignals(menuItem, menuItem.menu);
             this._connectItemSignals(menuItem);
-            menuItem._closingId = this.connect('open-state-changed', function(self, open) {
-                if (!open)
-                    menuItem.menu.close(BoxPointer.PopupAnimation.FADE);
+            menuItem._closingId = this.connect('menu-closed', function() {
+                menuItem.menu.close(BoxPointer.PopupAnimation.NONE);
             });
         } else if (menuItem instanceof PopupSeparatorMenuItem) {
             this._connectItemSignals(menuItem);
@@ -1096,8 +1099,11 @@ const PopupMenu = new Lang.Class({
             childMenu.close();
         });
 
-        if (this._boxPointer.actor.visible)
-            this._boxPointer.hide(animate);
+        if (this._boxPointer.actor.visible) {
+            this._boxPointer.hide(animate, Lang.bind(this, function() {
+                this.emit('menu-closed');
+            }));
+        }
 
         if (!this.isOpen)
             return;


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