From 0297f55c6d4be505fe6831a593ed2630d565e14a Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 21 Oct 2011 17:26:47 +0200 Subject: EXP-1416 FIXED "Speak" and "Voice controls" buttons added as control views in LLTransientFloaterMgr to prevent hiding the transient IM floater. --- indra/newview/lltransientfloatermgr.cpp | 34 +++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'indra/newview/lltransientfloatermgr.cpp') diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index c648a6a28a..d15efb048b 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 >(GLOBAL, std::set())); - mGroupControls.insert(std::pair >(DOCKED, std::set())); - mGroupControls.insert(std::pair >(IM, std::set())); + mGroupControls.insert(std::pair(GLOBAL, controls_set_t())); + mGroupControls.insert(std::pair(DOCKED, controls_set_t())); + mGroupControls.insert(std::pair(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,23 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) } } -bool LLTransientFloaterMgr::isControlClicked(std::set& set, S32 x, S32 y) +bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y) { bool res = true; for (controls_set_t::iterator it = set.begin(); it != set.end(); it++) { - LLView* control_view = *it; + LLView* control_view = NULL; + + LLHandle handle = *it; + if (handle.isDead()) + { + mGroupControls.find(group)->second.erase(handle); + continue; + } + + control_view = handle.get(); + if (!control_view->getVisible()) { continue; @@ -130,8 +144,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); -- cgit v1.3 From 8874ac39c1928bcb70c4f63cd3cfaeb75712d00e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 24 Oct 2011 17:06:48 -0700 Subject: EXP-1462 FIX -- Moving speak button or voice settings button between toolbars can cause viewer to crash on Mac * Updated iterator code to not erase stuff while we're iterating through it! Reviewed by Richard. --- indra/newview/lltransientfloatermgr.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/lltransientfloatermgr.cpp') diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp index d15efb048b..3d68c10489 100644 --- a/indra/newview/lltransientfloatermgr.cpp +++ b/indra/newview/lltransientfloatermgr.cpp @@ -104,6 +104,8 @@ void LLTransientFloaterMgr::hideTransientFloaters(S32 x, S32 y) bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set_t& set, S32 x, S32 y) { + std::list< LLHandle > dead_handles; + bool res = true; for (controls_set_t::iterator it = set.begin(); it != set.end(); it++) @@ -113,7 +115,7 @@ bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set LLHandle handle = *it; if (handle.isDead()) { - mGroupControls.find(group)->second.erase(handle); + dead_handles.push_back(handle); continue; } @@ -132,6 +134,13 @@ bool LLTransientFloaterMgr::isControlClicked(ETransientGroup group, controls_set break; } } + + for (std::list< LLHandle >::iterator it = dead_handles.begin(); it != dead_handles.end(); ++it) + { + LLHandle handle = *it; + mGroupControls.find(group)->second.erase(handle); + } + return res; } -- cgit v1.3