summaryrefslogtreecommitdiff
path: root/indra/newview/lltransientfloatermgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltransientfloatermgr.cpp')
-rw-r--r--indra/newview/lltransientfloatermgr.cpp43
1 files changed, 33 insertions, 10 deletions
diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp
index c648a6a28a..3d68c10489 100644
--- a/indra/newview/lltransientfloatermgr.cpp
+++ b/indra/newview/lltransientfloatermgr.cpp
@@ -42,9 +42,9 @@ LLTransientFloaterMgr::LLTransientFloaterMgr()
&LLTransientFloaterMgr::leftMouseClickCallback, this, _2, _3, _4));
}
- mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(GLOBAL, std::set<LLView*>()));
- mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(DOCKED, std::set<LLView*>()));
- mGroupControls.insert(std::pair<ETransientGroup, std::set<LLView*> >(IM, std::set<LLView*>()));
+ mGroupControls.insert(std::pair<ETransientGroup, controls_set_t >(GLOBAL, controls_set_t()));
+ mGroupControls.insert(std::pair<ETransientGroup, controls_set_t >(DOCKED, controls_set_t()));
+ mGroupControls.insert(std::pair<ETransientGroup, controls_set_t >(IM, controls_set_t()));
}
void LLTransientFloaterMgr::registerTransientFloater(LLTransientFloater* floater)
@@ -59,12 +59,16 @@ void LLTransientFloaterMgr::unregisterTransientFloater(LLTransientFloater* float
void LLTransientFloaterMgr::addControlView(ETransientGroup group, LLView* view)
{
- mGroupControls.find(group)->second.insert(view);
+ if (!view) return;
+
+ mGroupControls.find(group)->second.insert(view->getHandle());
}
void LLTransientFloaterMgr::removeControlView(ETransientGroup group, LLView* view)
{
- mGroupControls.find(group)->second.erase(view);
+ if (!view) return;
+
+ mGroupControls.find(group)->second.erase(view->getHandle());
}
void LLTransientFloaterMgr::addControlView(LLView* view)
@@ -89,7 +93,7 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y)
{
ETransientGroup group = floater->getGroup();
- bool hide = isControlClicked(mGroupControls.find(group)->second, x, y);
+ bool hide = isControlClicked(group, mGroupControls.find(group)->second, x, y);
if (hide)
{
floater->setTransientVisible(FALSE);
@@ -98,13 +102,25 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y)
}
}
-bool LLTransientFloaterMgr::isControlClicked(std::set<LLView*>& set, S32 x, S32 y)
+bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y)
{
+ std::list< LLHandle<LLView> > dead_handles;
+
bool res = true;
for (controls_set_t::iterator it = set.begin(); it
!= set.end(); it++)
{
- LLView* control_view = *it;
+ LLView* control_view = NULL;
+
+ LLHandle<LLView> handle = *it;
+ if (handle.isDead())
+ {
+ dead_handles.push_back(handle);
+ continue;
+ }
+
+ control_view = handle.get();
+
if (!control_view->getVisible())
{
continue;
@@ -118,6 +134,13 @@ bool LLTransientFloaterMgr::isControlClicked(std::set<LLView*>& set, S32 x, S32
break;
}
}
+
+ for (std::list< LLHandle<LLView> >::iterator it = dead_handles.begin(); it != dead_handles.end(); ++it)
+ {
+ LLHandle<LLView> handle = *it;
+ mGroupControls.find(group)->second.erase(handle);
+ }
+
return res;
}
@@ -130,8 +153,8 @@ void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y,
return;
}
- bool hide = isControlClicked(mGroupControls.find(DOCKED)->second, x, y)
- && isControlClicked(mGroupControls.find(GLOBAL)->second, x, y);
+ bool hide = isControlClicked(DOCKED, mGroupControls.find(DOCKED)->second, x, y)
+ && isControlClicked(GLOBAL, mGroupControls.find(GLOBAL)->second, x, y);
if (hide)
{
hideTransientFloaters(x, y);