[gnome-shell] Bug 578807 - Menu selection not reset on mouse selection



commit 5f01854c62d709d2403b78553651923dbf9888c0
Author: Colin Walters <walters verbum org>
Date:   Mon Apr 13 15:41:13 2009 -0400

    Bug 578807 - Menu selection not reset on mouse selection
    
    Clean up how we handle transitions a bit so that in the
    case of selection by mouse instead of keynav we correctly
    reset state.
---
 js/ui/appDisplay.js |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index ab2dd08..ac99663 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -314,10 +314,7 @@ AppDisplay.prototype = {
     _selectMenuIndex: function(index) {
         if (index < 0 || index >= this._menus.length)
             return;
-        if (this._activeMenu != null)
-            this._activeMenu.setState(MENU_UNSELECTED);
-        this._activeMenu = this._menuDisplays[index];
-        this._activeMenu.setState(MENU_SELECTED);
+        this._menuDisplays[index].setState(MENU_SELECTED);
     },
 
     _redisplayMenus: function() {
@@ -333,8 +330,8 @@ AppDisplay.prototype = {
                     this._activeMenuIndex = -1;
                     this._activeMenu = null;
                 } else if (activated) {
-                    if (this._activeMenu != null)
-                        this._activeMenu.setState(MENU_SELECTED);
+                    if (display != this._activeMenu && this._activeMenu != null)
+                        this._activeMenu.setState(MENU_UNSELECTED);
                     this._activeMenuIndex = menuIndex;
                     this._activeMenu = display;
                     this._activeMenuApps = this._appMonitor.get_applications_for_menu(menu.id);



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