From 1bf989705cf33fa27e404743108c6920cf33a7f2 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 18 Mar 2010 19:56:24 +0200 Subject: =?UTF-8?q?fixed=20EXT-5630=20=E2=80=9Cnearby=20chat=20flickers=20?= =?UTF-8?q?when=20top=20line=20fades=20out=E2=80=9D,=20used=20reverse=20or?= =?UTF-8?q?der=20to=20provide=20correct=20z-order=20and=20avoid=20toast=20?= =?UTF-8?q?blinking=20caused=20by=20z-reordering;=20reviewed=20by=20Vadim?= =?UTF-8?q?=20at=20https://codereview.productengine.com/secondlife/r/57/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/newview/llnearbychathandler.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'indra/newview/llnearbychathandler.cpp') diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 08ae93c3a6..e199f9f180 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -268,24 +268,23 @@ void LLNearbyChatScreenChannel::showToastsBottom() } break; } - else - { - toast_rect = toast->getRect(); - toast_rect.setLeftTopAndSize(getRect().mLeft , toast_top, toast_rect.getWidth() ,toast_rect.getHeight()); - - toast->setRect(toast_rect); - toast->setIsHidden(false); - toast->setVisible(TRUE); + bottom = toast_top - toast->getTopPad(); + } - if(!toast->hasFocus()) - { - // Fixing Z-order of toasts (EXT-4862) - // Next toast will be positioned under this one. - gFloaterView->sendChildToBack(toast); - } - - bottom = toast->getRect().mTop - toast->getTopPad(); - } + // use reverse order to provide correct z-order and avoid toast blinking + for(std::vector::reverse_iterator it = m_active_toasts.rbegin(); it != m_active_toasts.rend(); ++it) + { + LLToast* toast = (*it); + S32 toast_top = bottom + toast->getTopPad(); + + toast_rect = toast->getRect(); + toast_rect.setLeftTopAndSize(getRect().mLeft , toast_top, toast_rect.getWidth() ,toast_rect.getHeight()); + + toast->setRect(toast_rect); + toast->setIsHidden(false); + toast->setVisible(TRUE); + + bottom = toast->getRect().mBottom - margin; } } -- cgit v1.2.3