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



commit 8c16bf4e752f4581ebef8ad9f477be4194d637f1
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.

 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 6388b60..dada05c 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -2105,7 +2105,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]