From 49ae085d4c02045a70eeed3d8cd57c22d2594c0c Mon Sep 17 00:00:00 2001
From: Vadim ProductEngine <vsavchuk@productengine.com>
Date: Mon, 27 Sep 2010 22:32:01 +0300
Subject: STORM-207 FIXED Favorites overflow menu didn't close when you press
 ESC.

Caused by the fix of EXT-4217 which I had to revert.
---
 indra/newview/llfavoritesbar.cpp | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index dd1f92a25c..3981b887ad 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -290,20 +290,6 @@ public:
 		return TRUE;
 	}
 
-	void setVisible(BOOL b)
-	{
-		// Overflow menu shouldn't hide when it still has focus. See EXT-4217.
-		if (!b && hasFocus())
-			return;
-		LLToggleableMenu::setVisible(b);
-		setFocus(b);
-	}
-
-	void onFocusLost()
-	{
-		setVisible(FALSE);
-	}
-
 protected:
 	LLFavoriteLandmarkToggleableMenu(const LLToggleableMenu::Params& p):
 		LLToggleableMenu(p)
@@ -790,7 +776,6 @@ void LLFavoritesBarCtrl::updateButtons()
 		LLToggleableMenu* overflow_menu = static_cast <LLToggleableMenu*> (mPopupMenuHandle.get());
 		if (overflow_menu && overflow_menu->getVisible())
 		{
-			overflow_menu->setFocus(FALSE);
 			overflow_menu->setVisible(FALSE);
 			if (mUpdateDropDownItems)
 				showDropDownMenu();
@@ -911,8 +896,6 @@ void LLFavoritesBarCtrl::showDropDownMenu()
 
 	if (menu)
 	{
-		// Release focus to allow changing of visibility.
-		menu->setFocus(FALSE);
 		if (!menu->toggleVisibility())
 			return;
 
@@ -1093,6 +1076,14 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata)
 	{
 		gInventory.removeItem(mSelectedItemID);
 	}
+
+	// Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item).
+	// See EXT-4217 and STORM-207.
+	LLToggleableMenu* menu = (LLToggleableMenu*) mPopupMenuHandle.get();
+	if (menu && !menu->getVisible())
+	{
+		showDropDownMenu();
+	}
 }
 
 BOOL LLFavoritesBarCtrl::isClipboardPasteable() const
-- 
cgit v1.2.3