diff options
-rw-r--r-- | indra/newview/llscreenchannel.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llscreenchannel.h | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 222b462d1a..f66f725070 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -78,6 +78,22 @@ LLScreenChannelBase::~LLScreenChannelBase() { mWorldViewRectConnection.disconnect(); } + +bool LLScreenChannelBase::isHovering() +{ + bool res = mHoveredToast != NULL; + if (!res) + { + return res; + } + + S32 x, y; + mHoveredToast->screenPointToLocal(gViewerWindow->getCurrentMouseX(), + gViewerWindow->getCurrentMouseY(), &x, &y); + res = mHoveredToast->pointInView(x, y) == TRUE; + return res; +} + void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect) { S32 top_delta = old_world_rect.mTop - new_world_rect.mTop; @@ -644,7 +660,7 @@ void LLNotificationsUI::LLScreenChannel::startFadingToasts() if (!mToastList.size()) return; //because onMouseLeave is processed after onMouseEnter - if (mHoveredToast) return; + if (isHovering()) return; std::vector<ToastElem>::iterator it = mToastList.begin(); while (it != mToastList.end()) diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index b551732133..b8efbb148f 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -95,7 +95,7 @@ public: virtual void setControlHovering(bool control) { mControlHovering = control; } - bool isHovering() { return mHoveredToast != NULL; } + bool isHovering(); void setCanStoreToasts(bool store) { mCanStoreToasts = store; } |