From 51d9939b72ab9c86fda75efd7618adbb38703e8d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 4 Dec 2015 14:21:40 +0100 Subject: [PATCH] FIRE-6651: Modal alert toasts don't restore focus properly LLFloater is a focus root and in case of a LLFloater hosted inside an LLMultiFloater, the floater itself is erroneously stored as the previously focused view. So an additional check is required to make sure we do not store the LLFloater, but its hosting LLMultiFloater as focus root. --- indra/newview/lltoastalertpanel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 1d96e0b3aa..6739fb5d1b 100755 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -73,7 +73,10 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal LLView* current_selection = dynamic_cast(gFocusMgr.getKeyboardFocus()); while(current_selection) { - if (current_selection->isFocusRoot()) + // FIRE-6651: Modal alert toasts don't restore focus properly + //if (current_selection->isFocusRoot()) + if (current_selection->isFocusRoot() && (!dynamic_cast(current_selection) || !dynamic_cast(current_selection)->getHost())) + // { mPreviouslyFocusedView = current_selection->getHandle(); break; @@ -450,7 +453,10 @@ LLToastAlertPanel::~LLToastAlertPanel() LLView* current_selection = dynamic_cast(gFocusMgr.getKeyboardFocus()); while(current_selection) { - if (current_selection->isFocusRoot()) + // FIRE-6651: Modal alert toasts don't restore focus properly + //if (current_selection->isFocusRoot()) + if (current_selection->isFocusRoot() && (!dynamic_cast(current_selection) || !dynamic_cast(current_selection)->getHost())) + // { break; }