summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2016-05-18 13:15:01 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2016-05-18 13:15:01 +0300
commit191c2aec49491c74a6ce9b23a813dc89d63f2c6a (patch)
treef32dedb9579c5d1b5ebe21fe846cde41e4a0a5eb
parente3afb1fdbadd3d6cdae7c261e7a975f3bf9faa89 (diff)
MAINT-6377 Nearby chat toasts cover the conversation floater.
-rwxr-xr-xindra/newview/llfloaterimnearbychathandler.cpp25
-rwxr-xr-xindra/newview/llfloaterimsessiontab.cpp6
-rwxr-xr-xindra/newview/llfloaterimsessiontab.h2
3 files changed, 30 insertions, 3 deletions
diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp
index 1f85c5ac1b..9fd731ed56 100755
--- a/indra/newview/llfloaterimnearbychathandler.cpp
+++ b/indra/newview/llfloaterimnearbychathandler.cpp
@@ -601,12 +601,31 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
toast_msg = chat_msg.mText;
}
+ bool chat_overlaps = false;
+ if(nearby_chat->getChatHistory())
+ {
+ LLRect chat_rect = nearby_chat->getChatHistory()->calcScreenRect();
+ for (std::list<LLView*>::const_iterator child_iter = gFloaterView->getChildList()->begin();
+ child_iter != gFloaterView->getChildList()->end(); ++child_iter)
+ {
+ LLView *view = *child_iter;
+ const LLRect& rect = view->getRect();
+ if(view->isInVisibleChain() && (rect.overlaps(chat_rect)))
+ {
+ if(!nearby_chat->getChatHistory()->hasAncestor(view))
+ {
+ chat_overlaps = true;
+ }
+ break;
+ }
+ }
+ }
//Don't show nearby toast, if conversation is visible and selected
if ((nearby_chat->hasFocus()) ||
(LLFloater::isVisible(nearby_chat) && nearby_chat->isTornOff() && !nearby_chat->isMinimized()) ||
- ((im_box->getSelectedSession().isNull() &&
- ((LLFloater::isVisible(im_box) && !im_box->isMinimized() && im_box->isFrontmost())
- || (LLFloater::isVisible(nearby_chat) && !nearby_chat->isMinimized() && nearby_chat->isFrontmost())))))
+ ((im_box->getSelectedSession().isNull() && !chat_overlaps &&
+ ((LLFloater::isVisible(im_box) && !nearby_chat->isTornOff() && !im_box->isMinimized())
+ || (LLFloater::isVisible(nearby_chat) && nearby_chat->isTornOff() && !nearby_chat->isMinimized())))))
{
if(nearby_chat->isMessagePaneExpanded())
{
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 357b635594..2cd94c592a 100755
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -1094,6 +1094,12 @@ void LLFloaterIMSessionTab::saveCollapsedState()
gSavedPerAccountSettings.setBOOL("NearbyChatIsNotCollapsed", isMessagePaneExpanded());
}
}
+
+LLView* LLFloaterIMSessionTab::getChatHistory()
+{
+ return mChatHistory;
+}
+
BOOL LLFloaterIMSessionTab::handleKeyHere(KEY key, MASK mask )
{
BOOL handled = FALSE;
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index e7b05a584b..1b4922fd73 100755
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -103,6 +103,8 @@ public:
void restoreFloater();
void saveCollapsedState();
+ LLView* getChatHistory();
+
protected:
// callback for click on any items of the visual states menu