From 7d261eb9cf95efdeb546fe8b39568015d840c61a Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Tue, 8 Dec 2009 20:34:30 +0200 Subject: =?UTF-8?q?fixed=20EXT-3193=20=E2=80=9CClosing=20toasts=20cause=20?= =?UTF-8?q?blocking=20toast=20screen=20channel.=E2=80=9D,=20added=20direct?= =?UTF-8?q?=20check=20of=20toast=20hovering=20to=20avoid=20collisions=20wi?= =?UTF-8?q?th=20order=20of=20mouseEnter=20and=20mouseLeave=20events;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit corrected EXT-3096, added call off startFadingToasts in deleteToast since mouseLeave not will be called in case closing toast; --HG-- branch : product-engine --- indra/newview/llscreenchannel.cpp | 44 +++++++++++++++------------------------ indra/newview/llscreenchannel.h | 1 - 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index a1ea7aeb96..7ea1674da1 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -243,6 +243,7 @@ void LLScreenChannel::deleteToast(LLToast* toast) if(mHoveredToast == toast) { mHoveredToast = NULL; + startFadingToasts(); } // close the toast @@ -720,39 +721,28 @@ void LLScreenChannel::removeToastsBySessionID(LLUUID id) //-------------------------------------------------------------------------- void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter) { - // because of LLViewerWindow::updateUI() that ALWAYS calls onMouseEnter BEFORE onMouseLeave - // we must check this to prevent incorrect setting for hovering in a channel - std::map::iterator it_first, it_second; - S32 stack_size = mToastEventStack.size(); - if(mouse_enter) + // because of LLViewerWindow::updateUI() that NOT ALWAYS calls onMouseEnter BEFORE onMouseLeave + // we must check hovering directly to prevent incorrect setting for hovering in a channel + S32 x,y; + if (mouse_enter) { - mHoveredToast = toast; - } - else - { - mHoveredToast = NULL; - } - - switch(stack_size) - { - case 0: - mToastEventStack.insert(std::pair(toast, mouse_enter)); - break; - case 1: - it_first = mToastEventStack.begin(); - if((*it_first).second && !mouse_enter && ((*it_first).first != toast) ) + toast->screenPointToLocal(gViewerWindow->getCurrentMouseX(), + gViewerWindow->getCurrentMouseY(), &x, &y); + bool hover = toast->pointInView(x, y) == TRUE; + if (hover) { - mToastEventStack.clear(); mHoveredToast = toast; } - else + } + else if (mHoveredToast != NULL) + { + mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(), + gViewerWindow->getCurrentMouseY(), &x, &y); + bool hover = mHoveredToast->pointInView(x, y) == TRUE; + if (!hover) { - mToastEventStack.clear(); - mToastEventStack.insert(std::pair(toast, mouse_enter)); + mHoveredToast = NULL; } - break; - default: - LL_ERRS ("LLScreenChannel::onToastHover: stack size error " ) << stack_size << llendl; } if(!isHovering()) diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 3b0ee2050c..b551732133 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -279,7 +279,6 @@ private: std::vector mToastList; std::vector mStoredToastList; - std::map mToastEventStack; }; } -- cgit v1.2.3