summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llfloater.cpp1
-rw-r--r--indra/llui/llfloater.h2
-rw-r--r--indra/newview/llfloaterimcontainer.cpp9
-rw-r--r--indra/newview/llfloaterimcontainer.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index d97569839a..b5e81748a3 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1475,6 +1475,7 @@ void LLFloater::moveResizeHandlesToFront()
}
}
+/*virtual*/
BOOL LLFloater::isFrontmost()
{
LLFloaterView* floater_view = getParentByType<LLFloaterView>();
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 26ac4a98ad..6e0df847cf 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -262,7 +262,7 @@ public:
static bool isVisible(const LLFloater* floater);
static bool isMinimized(const LLFloater* floater);
BOOL isFirstLook() { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts
- BOOL isFrontmost();
+ virtual BOOL isFrontmost();
BOOL isDependent() { return !mDependeeHandle.isDead(); }
void setCanMinimize(BOOL can_minimize);
void setCanClose(BOOL can_close);
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 7626a3eab8..51796b7486 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -2067,6 +2067,15 @@ void LLFloaterIMContainer::expandConversation()
}
}
+// By default, if torn off session is currently frontmost, LLFloater::isFrontmost() will return FALSE, which can lead to some bugs
+// So LLFloater::isFrontmost() is overriden here to check both selected session and the IM floater itself
+/*virtual*/
+BOOL LLFloaterIMContainer::isFrontmost()
+{
+ LLFloaterIMSessionTab* selected_session = LLFloaterIMSessionTab::getConversation(mSelectedSession);
+ return (selected_session && selected_session->isFrontmost()) || LLFloater::isFrontmost();
+}
+
// For conversations, closeFloater() (linked to Ctrl-W) does not actually close the floater but the active conversation.
// This is intentional so it doesn't confuse the user. onClickCloseBtn() closes the whole floater.
void LLFloaterIMContainer::onClickCloseBtn()
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index 259b28f952..072a83d547 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -118,6 +118,7 @@ public:
void assignResizeLimits();
virtual BOOL handleKeyHere(KEY key, MASK mask );
/*virtual*/ void closeFloater(bool app_quitting = false);
+ /*virtual*/ BOOL isFrontmost();
private:
typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t;