From 5f01854c62d709d2403b78553651923dbf9888c0 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 13 Apr 2009 15:41:13 -0400 Subject: [PATCH] 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 file changed, 3 insertions(+), 6 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index ab2dd089c..ac9966337 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);