diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index bae66a518b5252d5ceb29283e24cf44a51c98133..6ff31632652c5aeb8e8b220005d9202a14b9ba96 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -561,7 +561,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); @@ -2747,7 +2746,8 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore if (!child) return; - if (!mFrontChild.isDead() && mFrontChild.get() == child) + LLFloater* front_child = mFrontChildHandle.get(); + if (front_child == child) { if (give_focus && child->canFocusStealFrontmost() && !gFocusMgr.childHasKeyboardFocus(child)) { @@ -2756,12 +2756,12 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore return; } - if (!mFrontChild.isDead()) + if (front_child && front_child->getVisible()) { - mFrontChild.get()->goneFromFront(); + front_child->goneFromFront(); } - mFrontChild = child->getHandle(); + mFrontChildHandle = child->getHandle(); // *TODO: make this respect floater's mAutoFocus value, instead of // using parameter @@ -3265,7 +3265,8 @@ LLFloater *LLFloaterView::getBackmost() const void LLFloaterView::syncFloaterTabOrder() { - if (!mFrontChild.isDead() && mFrontChild.get() && mFrontChild.get()->getIsChrome()) + LLFloater* front_child = mFrontChildHandle.get(); + if (front_child && front_child->getIsChrome()) return; // look for a visible modal dialog, starting from first @@ -3307,11 +3308,12 @@ void LLFloaterView::syncFloaterTabOrder() LLFloater* floaterp = static_cast<LLFloater*>(*child_it); if (gFocusMgr.childHasKeyboardFocus(floaterp)) { - if (!mFrontChild.isDead() && mFrontChild.get() != 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.get() && !mFrontChild.get()->canFocusStealFrontmost()) + if (front_child && !front_child->canFocusStealFrontmost()) { for (LLView* childp : *getChildList()) { @@ -3331,7 +3333,7 @@ void LLFloaterView::syncFloaterTabOrder() { sendChildToFront(childp); } - mFrontChild = listTop.back()->getHandle(); + mFrontChildHandle = listTop.back()->getHandle(); } } @@ -3427,14 +3429,6 @@ void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LL } } -void LLFloaterView::onDestroyFloater(LLFloater* floater) -{ - if (mFrontChild.get() == floater) - { - mFrontChild = {}; - } -} - void LLFloater::setInstanceName(const std::string& name) { if (name != mInstanceName) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 5a40c42a08512ce704c8446002d62b3c3b1bbff8..0f0ecc8047ad4cb1f2fc18aa295361d53a50bf6e 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -653,7 +653,6 @@ class LLFloaterView : public LLUICtrl LLFloater* getFrontmostClosableFloater(); void setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect); - void onDestroyFloater(LLFloater* floater); private: void hiddenFloaterClosed(LLFloater* floater); @@ -670,7 +669,7 @@ class LLFloaterView : public LLUICtrl S32 mMinimizePositionVOffset; typedef std::vector<std::pair<LLHandle<LLFloater>, boost::signals2::connection> > hidden_floaters_t; hidden_floaters_t mHiddenFloaters; - LLHandle<LLFloater> mFrontChild; + LLHandle<LLFloater> mFrontChildHandle; }; //