diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lldockablefloater.cpp | 14 | ||||
-rw-r--r-- | indra/llui/lldockablefloater.h | 2 | ||||
-rw-r--r-- | indra/llui/llfloater.cpp | 11 |
3 files changed, 18 insertions, 9 deletions
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 29f78f6290..ed15d9d922 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -35,7 +35,7 @@ #include "lldockablefloater.h" //static -LLDockableFloater* LLDockableFloater::instance = NULL; +LLHandle<LLFloater> LLDockableFloater::instanceHandle; LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, const LLSD& key, const Params& params) : @@ -57,21 +57,21 @@ BOOL LLDockableFloater::postBuild() void LLDockableFloater::resetInstance() { - if (instance != this) + if (instanceHandle.get() != this) { - if (instance != NULL && instance->isDocked()) + if (instanceHandle.get() != NULL && instanceHandle.get()->isDocked()) { //closeFloater() is not virtual - if (instance->canClose()) + if (instanceHandle.get()->canClose()) { - instance->closeFloater(); + instanceHandle.get()->closeFloater(); } else { - instance->setVisible(FALSE); + instanceHandle.get()->setVisible(FALSE); } } - instance = this; + instanceHandle = getHandle(); } } diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index b977888803..1d0e89cef5 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -69,7 +69,7 @@ protected: private: std::auto_ptr<LLDockControl> mDockControl; LLUIImagePtr mDockTongue; - static LLDockableFloater* instance; + static LLHandle<LLFloater> instanceHandle; }; #endif /* LL_DOCKABLEFLOATER_H */ diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c027b59c71..228e23b67e 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1491,7 +1491,8 @@ LLFloater* LLFloater::getClosableFloaterFromFocus() // The focused floater may not be closable, // Find and close a parental floater that is closeable, if any. - for(LLFloater* floater_to_close = focused_floater; + LLFloater* prev_floater = NULL; + for(LLFloater* floater_to_close = focused_floater; NULL != floater_to_close; floater_to_close = gFloaterView->getParentFloater(floater_to_close)) { @@ -1499,6 +1500,14 @@ LLFloater* LLFloater::getClosableFloaterFromFocus() { return floater_to_close; } + + // If floater has as parent root view + // gFloaterView->getParentFloater(floater_to_close) returns + // the same floater_to_close, so we need to check this. + if (prev_floater == floater_to_close) { + break; + } + prev_floater = floater_to_close; } return NULL; |