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; }