[gnome-shell/wip/message-tray-menu: 69/109] popupMenu: Don't use "grabbed" to determine whether to change menus



commit 3dd4bd11cb8e4471f205b7654645853520c38ed4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Apr 19 12:14:45 2013 -0400

    popupMenu: Don't use "grabbed" to determine whether to change menus
    
    If we have an existing non-menu grab on the grab helper, we shouldn't
    open a menu when hovering. Make sure that the topmost grab is indeed
    a menu.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=699272

 js/ui/grabHelper.js |    6 +-----
 js/ui/popupMenu.js  |    2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/grabHelper.js b/js/ui/grabHelper.js
index 9f1374e..9659dc5 100644
--- a/js/ui/grabHelper.js
+++ b/js/ui/grabHelper.js
@@ -82,10 +82,6 @@ const GrabHelper = new Lang.Class({
         return this._grabStack[this._grabStack.length - 1] || {};
     },
 
-    get grabbed() {
-        return this._grabStack.length > 0;
-    },
-
     get grabStack() {
         return this._grabStack;
     },
@@ -305,7 +301,7 @@ const GrabHelper = new Lang.Class({
                 this._releaseFocusGrab();
         }
 
-        if (!this.grabbed && this._capturedEventId > 0) {
+        if (this._grabStack.length == 0 && this._capturedEventId > 0) {
             global.stage.disconnect(this._capturedEventId);
             this._capturedEventId = 0;
 
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 56cb851..71fff49 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -2082,7 +2082,7 @@ const PopupMenuManager = new Lang.Class({
     },
 
     _onMenuSourceEnter: function(menu) {
-        if (!this._grabHelper.grabbed)
+        if (!this.activeMenu)
             return false;
 
         if (this._grabHelper.isActorGrabbed(menu.actor))


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