summaryrefslogtreecommitdiff
path: root/indra/llui/llfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r--indra/llui/llfloater.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 5787bc5929..e6a47ca3eb 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -506,7 +506,6 @@ void LLFloater::enableResizeCtrls(bool enable, bool width, bool height)
void LLFloater::destroy()
{
- gFloaterView->onDestroyFloater(this);
// LLFloaterReg should be synchronized with "dead" floater to avoid returning dead instance before
// it was deleted via LLMortician::updateClass(). See EXT-8458.
LLFloaterReg::removeInstance(mInstanceName, mKey);
@@ -2406,8 +2405,7 @@ LLFloaterView::LLFloaterView (const Params& p)
mFocusCycleMode(FALSE),
mMinimizePositionVOffset(0),
mSnapOffsetBottom(0),
- mSnapOffsetRight(0),
- mFrontChild(NULL)
+ mSnapOffsetRight(0)
{
mSnapView = getHandle();
}
@@ -2563,7 +2561,8 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore
if (!child)
return;
- if (mFrontChild == child)
+ LLFloater* front_child = mFrontChildHandle.get();
+ if (front_child == child)
{
if (give_focus && child->canFocusStealFrontmost() && !gFocusMgr.childHasKeyboardFocus(child))
{
@@ -2572,12 +2571,12 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore
return;
}
- if (mFrontChild)
+ if (front_child && front_child->getVisible())
{
- mFrontChild->goneFromFront();
+ front_child->goneFromFront();
}
- mFrontChild = child;
+ mFrontChildHandle = child->getHandle();
// *TODO: make this respect floater's mAutoFocus value, instead of
// using parameter
@@ -3076,7 +3075,8 @@ LLFloater *LLFloaterView::getBackmost() const
void LLFloaterView::syncFloaterTabOrder()
{
- if (mFrontChild && !mFrontChild->isDead() && mFrontChild->getIsChrome())
+ LLFloater* front_child = mFrontChildHandle.get();
+ if (front_child && front_child->getIsChrome())
return;
// look for a visible modal dialog, starting from first
@@ -3114,11 +3114,12 @@ void LLFloaterView::syncFloaterTabOrder()
LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it);
if (gFocusMgr.childHasKeyboardFocus(floaterp))
{
- if (mFrontChild != floaterp)
+ LLFloater* front_child = mFrontChildHandle.get();
+ if (front_child != floaterp)
{
// Grab a list of the top floaters that want to stay on top of the focused floater
std::list<LLFloater*> listTop;
- if (mFrontChild && !mFrontChild->canFocusStealFrontmost())
+ if (front_child && !front_child->canFocusStealFrontmost())
{
for (LLView* childp : *getChildList())
{
@@ -3138,7 +3139,7 @@ void LLFloaterView::syncFloaterTabOrder()
{
sendChildToFront(childp);
}
- mFrontChild = listTop.back();
+ mFrontChildHandle = listTop.back()->getHandle();
}
}
@@ -3234,14 +3235,6 @@ void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LL
}
}
-void LLFloaterView::onDestroyFloater(LLFloater* floater)
-{
- if (mFrontChild == floater)
- {
- mFrontChild = nullptr;
- }
-}
-
void LLFloater::setInstanceName(const std::string& name)
{
if (name != mInstanceName)