FIRE-16744: Speculative shot-into-the-blue fix for new IM tabs stealing focus
parent
5b468e997b
commit
a36e94757e
|
|
@ -2068,21 +2068,18 @@ void FSFloaterIM::sRemoveTypingIndicator(const LLSD& data)
|
|||
floater->removeTypingIndicator();
|
||||
}
|
||||
|
||||
void FSFloaterIM::onNewIMReceived( const LLUUID& session_id )
|
||||
void FSFloaterIM::onNewIMReceived(const LLUUID& session_id)
|
||||
{
|
||||
|
||||
if (isChatMultiTab())
|
||||
{
|
||||
FSFloaterIMContainer* im_box = FSFloaterIMContainer::getInstance();
|
||||
if (!im_box) return;
|
||||
|
||||
if (FSFloaterIM::findInstance(session_id)) return;
|
||||
if (FSFloaterIM::findInstance(session_id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FSFloaterIM* new_tab = FSFloaterIM::getInstance(session_id);
|
||||
|
||||
im_box->addFloater(new_tab, FALSE, LLTabContainer::END);
|
||||
FSFloaterIMContainer::getInstance()->addNewSession(new_tab);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FSFloaterIM::onClickCloseBtn(bool app_quitting)
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ FSFloaterIMContainer::FSFloaterIMContainer(const LLSD& seed)
|
|||
: LLMultiFloater(seed),
|
||||
mActiveVoiceFloater(NULL),
|
||||
mCurrentVoiceState(VOICE_STATE_NONE),
|
||||
mForceVoiceStateUpdate(false)
|
||||
mForceVoiceStateUpdate(false),
|
||||
mIsAddingNewSession(false)
|
||||
{
|
||||
mAutoResize = FALSE;
|
||||
LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::IM, this);
|
||||
|
|
@ -233,31 +234,34 @@ void FSFloaterIMContainer::addFloater(LLFloater* floaterp,
|
|||
{
|
||||
// [SL:KB] - Patch: UI-TabRearrange | Checked: 2012-06-22 (Catznip-3.3.0)
|
||||
// If we're redocking a torn off IM floater, return it back to its previous place
|
||||
if ( (floaterp->isTornOff()) && (LLTabContainer::END == insertion_point) )
|
||||
if (!mIsAddingNewSession && (floaterp->isTornOff()) && (LLTabContainer::END == insertion_point) )
|
||||
{
|
||||
LLChicletPanel* pChicletPanel = LLChicletBar::instance().getChicletPanel();
|
||||
|
||||
LLIMChiclet* pChiclet = pChicletPanel->findChiclet<LLIMChiclet>(floaterp->getKey());
|
||||
S32 idxChiclet = pChicletPanel->getChicletIndex(pChiclet);
|
||||
if ( (idxChiclet > 0) && (idxChiclet < pChicletPanel->getChicletCount()) )
|
||||
if (pChiclet)
|
||||
{
|
||||
// Look for the first IM session to the left of this one
|
||||
while (--idxChiclet >= 0)
|
||||
S32 idxChiclet = pChicletPanel->getChicletIndex(pChiclet);
|
||||
if ((idxChiclet > 0) && (idxChiclet < pChicletPanel->getChicletCount()))
|
||||
{
|
||||
if (pChiclet = dynamic_cast<LLIMChiclet*>(pChicletPanel->getChiclet(idxChiclet)))
|
||||
// Look for the first IM session to the left of this one
|
||||
while (--idxChiclet >= 0)
|
||||
{
|
||||
FSFloaterIM* pFloater = FSFloaterIM::findInstance(pChiclet->getSessionId());
|
||||
if (pFloater)
|
||||
if (pChiclet = dynamic_cast<LLIMChiclet*>(pChicletPanel->getChiclet(idxChiclet)))
|
||||
{
|
||||
insertion_point = (LLTabContainer::eInsertionPoint)(mTabContainer->getIndexForPanel(pFloater) + 1);
|
||||
break;
|
||||
FSFloaterIM* pFloater = FSFloaterIM::findInstance(pChiclet->getSessionId());
|
||||
if (pFloater)
|
||||
{
|
||||
insertion_point = (LLTabContainer::eInsertionPoint)(mTabContainer->getIndexForPanel(pFloater) + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
insertion_point = (0 == idxChiclet) ? LLTabContainer::START : LLTabContainer::END;
|
||||
else
|
||||
{
|
||||
insertion_point = (0 == idxChiclet) ? LLTabContainer::START : LLTabContainer::END;
|
||||
}
|
||||
}
|
||||
}
|
||||
// [/SL:KB]
|
||||
|
|
@ -270,6 +274,14 @@ void FSFloaterIMContainer::addFloater(LLFloater* floaterp,
|
|||
floaterp->mCloseSignal.connect(boost::bind(&FSFloaterIMContainer::onCloseFloater, this, session_id));
|
||||
}
|
||||
|
||||
void FSFloaterIMContainer::addNewSession(LLFloater* floaterp)
|
||||
{
|
||||
// Make sure we don't do some strange re-arranging if we add a new IM floater due to a new session
|
||||
mIsAddingNewSession = true;
|
||||
addFloater(floaterp, FALSE, LLTabContainer::END);
|
||||
mIsAddingNewSession = false;
|
||||
}
|
||||
|
||||
// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-12-11 (Catznip-3.2.0d) | Added: Catznip-3.2.0d
|
||||
void FSFloaterIMContainer::removeFloater(LLFloater* floaterp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ public:
|
|||
// [/SL:KB]
|
||||
bool hasFloater(LLFloater* floaterp);
|
||||
|
||||
void addNewSession(LLFloater* floaterp);
|
||||
|
||||
static FSFloaterIMContainer* findInstance();
|
||||
static FSFloaterIMContainer* getInstance();
|
||||
|
||||
|
|
@ -99,6 +101,8 @@ private:
|
|||
void checkFlashing();
|
||||
uuid_vec_t mFlashingSessions;
|
||||
|
||||
bool mIsAddingNewSession;
|
||||
|
||||
// [SL:KB] - Patch: UI-TabRearrange | Checked: 2012-05-05 (Catznip-3.3.0)
|
||||
protected:
|
||||
void onIMTabRearrange(S32 tab_index, LLPanel* tab_panel);
|
||||
|
|
|
|||
Loading…
Reference in New Issue