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.
This commit is contained in:
Colin Walters 2009-04-13 15:41:13 -04:00
parent a5a2112b31
commit 5f01854c62

View File

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