From b6e6ba224620e0b122062c88f40295c10ce8db2d Mon Sep 17 00:00:00 2001
From: Paul ProductEngine <pguslisty@productengine.com>
Date: Thu, 10 Mar 2011 14:21:35 +0200
Subject: [PATCH] STORM-357 FIXED Gestures button is in the pressed state after
 drag-n-drop but gestures list isn't visible.

- Because the Gesture Combo List isn't child of gViewerWindow->getNonSideTrayView(), after focus lost the gesture list becomes hidden under world.
  To avoid this, send child to front in each draw.
---
 indra/newview/llnearbychatbar.cpp | 11 +++++++++++
 indra/newview/llnearbychatbar.h   |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp
index 836ae9a0cfc..162e465fef8 100644
--- a/indra/newview/llnearbychatbar.cpp
+++ b/indra/newview/llnearbychatbar.cpp
@@ -157,6 +157,16 @@ BOOL LLGestureComboList::handleKeyHere(KEY key, MASK mask)
 	return handled; 		
 }
 
+void LLGestureComboList::draw()
+{
+	LLUICtrl::draw();
+
+	if(mButton->getToggleState())
+	{
+		showList();
+	}
+}
+
 void LLGestureComboList::showList()
 {
 	LLRect rect = mList->getRect();
@@ -180,6 +190,7 @@ void LLGestureComboList::showList()
 	// Show the list and push the button down
 	mButton->setToggleState(TRUE);
 	mList->setVisible(TRUE);
+	sendChildToFront(mList);
 	LLUI::addPopup(mList);
 }
 
diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h
index 033d1dd5a2c..96ab45071b2 100644
--- a/indra/newview/llnearbychatbar.h
+++ b/indra/newview/llnearbychatbar.h
@@ -72,6 +72,8 @@ class LLGestureComboList
 	virtual void	hideList();
 	virtual BOOL	handleKeyHere(KEY key, MASK mask);
 
+	virtual void	draw();
+
 	S32				getCurrentIndex() const;
 	void			onItemSelected(const LLSD& data);
 	void			sortByName(bool ascending = true);
-- 
GitLab