summaryrefslogtreecommitdiff
path: root/indra/newview/lltoastalertpanel.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-10-01 23:04:21 -0700
committerMerov Linden <merov@lindenlab.com>2014-10-01 23:04:21 -0700
commit6a36e843db211abcdcc13536bcf794b3724396e8 (patch)
treeb4905f642bc3aaf02b18c76af6a996ea5cfa33ce /indra/newview/lltoastalertpanel.cpp
parent4b80a5ed059d91bc37558db8ed664365e39d21d6 (diff)
DD-190 : When dismissing an alert, take into account that the last focused view may have changed since the alert was created
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 c82894a5cc..5aaba6614e 100755
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -68,19 +68,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();
@@ -432,7 +432,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);
+ }
}
}