From b0c54dfd3e2ecc8d4f875276397a55cef40a3d9a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 19 Oct 2012 17:47:28 -0700 Subject: CHUI-433: Problem: Toasts were not being displayed due to incorrect tracking of the current conversation with focus. Resolution: Now when a conversation gains focus it will set a flag to ignore toasts. And when a conversation loses focus it will set a flag to re-enable toasts. --- indra/newview/llimconversation.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/newview/llimconversation.cpp') diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index bd2a2419a8..f4b8d39cd0 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -202,16 +202,10 @@ void LLIMConversation::onFocusReceived() { setBackgroundOpaque(true); - if (mSessionID.notNull()) + if (mSessionID.notNull() && isInVisibleChain()) { - LLChicletBar::getInstance()->getChicletPanel()->setChicletToggleState(mSessionID, true); - - if (getVisible()) - { - // suppress corresponding toast only if this floater is visible and have focus - LLIMModel::getInstance()->setActiveSessionID(mSessionID); - LLIMModel::instance().sendNoUnreadMessages(mSessionID); - } + LLIMModel::getInstance()->setActiveSessionID(mSessionID); + LLIMModel::instance().sendNoUnreadMessages(mSessionID); } LLTransientDockableFloater::onFocusReceived(); @@ -219,6 +213,7 @@ void LLIMConversation::onFocusReceived() void LLIMConversation::onFocusLost() { + LLIMModel::getInstance()->resetActiveSessionID(); setBackgroundOpaque(false); LLTransientDockableFloater::onFocusLost(); } -- cgit v1.2.3 From 23d58c0c0906bd5434611cc73da9437ec7a5b830 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 22 Oct 2012 17:31:51 -0700 Subject: CHUI-433: Implemented an alternate solution to the problem. The original solution was ambiguous and incomplete and also preserved an existing hack. The new solution removes a hack/deprecated code (setActiveSession/getActiveSession functions). Basically, a toast message is not displayed if the user already has the conversation in focus. When the conversation floater loses focus toasts message will be displayed for that conversation. --- indra/newview/llimconversation.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llimconversation.cpp') diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index f4b8d39cd0..74bf8cb6fe 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -204,7 +204,6 @@ void LLIMConversation::onFocusReceived() if (mSessionID.notNull() && isInVisibleChain()) { - LLIMModel::getInstance()->setActiveSessionID(mSessionID); LLIMModel::instance().sendNoUnreadMessages(mSessionID); } @@ -213,7 +212,6 @@ void LLIMConversation::onFocusReceived() void LLIMConversation::onFocusLost() { - LLIMModel::getInstance()->resetActiveSessionID(); setBackgroundOpaque(false); LLTransientDockableFloater::onFocusLost(); } -- cgit v1.2.3