summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastalertpanel.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-08-04 16:36:30 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-08-04 16:36:30 +0300
commit01ba9f3cd69a40ddffcee84fda95460b0f87629e (patch)
treeebf28dd52bcbc8d53b5e833242c7f36b725b2ec3 /indra/newview/lltoastalertpanel.cpp
parent246758a3b70256f2c776d5372296b858251fd820 (diff)
parent310ec101dfd2c69ecc1a51d0a3a8ea12d5fdaf7a (diff)
Merge downstream code and become version 3.8.3
Diffstat (limited to 'indra/newview/lltoastalertpanel.cpp')
-rwxr-xr-xindra/newview/lltoastalertpanel.cpp45
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);
+ }
}
}