diff options
author | Oz Linden <oz@lindenlab.com> | 2015-09-04 13:15:48 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2015-09-04 13:15:48 -0400 |
commit | aafc82668073e26e8c8a951a96bff9b1d1993262 (patch) | |
tree | 1972c12ee782ff3635c07ee89f09f0215f55a969 /indra/newview/lltoastalertpanel.cpp | |
parent | c9af158e36eae83f6e3eba97762369affa84848b (diff) | |
parent | 1be63209331d509396bd7ee79302d511fe83d72e (diff) |
merge changes for 3.8.3-release
Diffstat (limited to 'indra/newview/lltoastalertpanel.cpp')
-rwxr-xr-x | indra/newview/lltoastalertpanel.cpp | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 0a9453534b..530bd9a18f 100755 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -67,19 +67,19 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal mLabel(notification->getName()), mLineEditor(NULL) { - // EXP-1822 - // save currently focused view, so that return focus to it - // on destroying this toast. - LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus()); - while(current_selection) - { - if (current_selection->isFocusRoot()) - { - mPreviouslyFocusedView = current_selection->getHandle(); - break; - } - current_selection = current_selection->getParent(); - } + // EXP-1822 + // save currently focused view, so that return focus to it + // on destroying this toast. + LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus()); + while(current_selection) + { + if (current_selection->isFocusRoot()) + { + mPreviouslyFocusedView = current_selection->getHandle(); + break; + } + current_selection = current_selection->getParent(); + } const LLFontGL* font = LLFontGL::getFontSansSerif(); const S32 LINE_HEIGHT = font->getLineHeight(); @@ -431,7 +431,24 @@ LLToastAlertPanel::~LLToastAlertPanel() // return focus to the previously focused view if the viewer is not exiting if (mPreviouslyFocusedView.get() && !LLApp::isExiting()) { - mPreviouslyFocusedView.get()->setFocus(TRUE); + LLView* current_selection = dynamic_cast<LLView*>(gFocusMgr.getKeyboardFocus()); + while(current_selection) + { + if (current_selection->isFocusRoot()) + { + break; + } + current_selection = current_selection->getParent(); + } + if (current_selection) + { + // If the focus moved to some other view though, move the focus there + current_selection->setFocus(TRUE); + } + else + { + mPreviouslyFocusedView.get()->setFocus(TRUE); + } } } |