[gnome-shell] popupMenu: Emit open-state-changed at the start of animating a submenu



commit 263474705b4b2caf61ffc4b6d19120e24279e4c8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Jun 11 18:29:36 2013 -0400

    popupMenu: Emit open-state-changed at the start of animating a submenu
    
    Doing it at the end has confusing semantics, especially as there is
    this point where isOpen is true, but the corresponding open-state-changed
    has not been emitted.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702539

 js/ui/popupMenu.js |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index a88a3c5..ce7f3cc 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -1155,6 +1155,7 @@ const PopupSubMenu = new Lang.Class({
             return;
 
         this.isOpen = true;
+        this.emit('open-state-changed', true);
 
         this.actor.show();
 
@@ -1193,12 +1194,10 @@ const PopupSubMenu = new Lang.Class({
                                onCompleteScope: this,
                                onComplete: function() {
                                    this.actor.set_height(-1);
-                                   this.emit('open-state-changed', true);
                                }
                              });
         } else {
             this._arrow.rotation_angle_z = 90;
-            this.emit('open-state-changed', true);
         }
     },
 
@@ -1207,6 +1206,7 @@ const PopupSubMenu = new Lang.Class({
             return;
 
         this.isOpen = false;
+        this.emit('open-state-changed', false);
 
         if (this._activeMenuItem)
             this._activeMenuItem.setActive(false);
@@ -1224,8 +1224,6 @@ const PopupSubMenu = new Lang.Class({
                                onComplete: function() {
                                    this.actor.hide();
                                    this.actor.set_height(-1);
-
-                                   this.emit('open-state-changed', false);
                                },
                                onUpdateScope: this,
                                onUpdate: function() {
@@ -1235,9 +1233,6 @@ const PopupSubMenu = new Lang.Class({
             } else {
                 this._arrow.rotation_angle_z = 0;
                 this.actor.hide();
-
-                this.isOpen = false;
-                this.emit('open-state-changed', false);
             }
     },
 


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