diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-06-03 23:46:55 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-06-03 23:47:07 +0300 |
commit | 416ad1831f40052fccc01f012c4452d61e57f0f8 (patch) | |
tree | 2c2d82bc04d385c3cbeff7662c4272b1e7f94406 /indra/llui/llfloaterreg.cpp | |
parent | 777f3f48d0e56ceff3aa98a44c6e6437946ae4f3 (diff) |
SL-15340 The list of parcels is duplicated after reopening
1. Clean list before requesting
2. Don't trigger onOpen from menu if already open
Diffstat (limited to 'indra/llui/llfloaterreg.cpp')
-rw-r--r-- | indra/llui/llfloaterreg.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 85e07fc6a6..0b27ff3567 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -525,6 +525,58 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& } // static +// Same as toggleInstanceOrBringToFront but does not close floater. +// unlike showInstance() does not trigger onOpen() if already open +void LLFloaterReg::showInstanceOrBringToFront(const LLSD& sdname, const LLSD& key) +{ + std::string name = sdname.asString(); + LLFloater* instance = getInstance(name, key); + + + if (!instance) + { + LL_DEBUGS() << "Unable to get instance of floater '" << name << "'" << LL_ENDL; + return; + } + + // If hosted, we need to take that into account + LLFloater* host = instance->getHost(); + + if (host) + { + if (host->isMinimized() || !host->isShown() || !host->isFrontmost()) + { + host->setMinimized(FALSE); + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->getVisible()) + { + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + instance->setFocus(TRUE); + } + } + else + { + if (instance->isMinimized()) + { + instance->setMinimized(FALSE); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->isShown()) + { + instance->openFloater(key); + instance->setVisibleAndFrontmost(true, key); + } + else if (!instance->isFrontmost()) + { + instance->setVisibleAndFrontmost(true, key); + } + } +} + +// static U32 LLFloaterReg::getVisibleFloaterInstanceCount() { U32 count = 0; |