diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 12ad0717992e9f01e5f415f48f6e1f040ad10839..ada7570776dcaf4568c2854faf00d35f8123f2ca 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -69,6 +69,15 @@ 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()); + if (current_selection) + { + mPreviouslyFocusedView = current_selection->getHandle(); + } + const LLFontGL* font = LLFontGL::getFontSansSerif(); const S32 LINE_HEIGHT = font->getLineHeight(); const S32 EDITOR_HEIGHT = 20; @@ -408,6 +417,13 @@ LLToastAlertPanel::~LLToastAlertPanel() { LLTransientFloaterMgr::instance().removeControlView( LLTransientFloaterMgr::GLOBAL, this); + + // EXP-1822 + // return focus to the previously focused view + if (mPreviouslyFocusedView.get()) + { + gFocusMgr.setKeyboardFocus(mPreviouslyFocusedView.get()); + } } BOOL LLToastAlertPanel::hasTitleBar() const diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h index 7b157f19bb10123af3c6c487496512ac5100b4e0..d1be5e018ead9eae01a34701e18eaef821f7726d 100644 --- a/indra/newview/lltoastalertpanel.h +++ b/indra/newview/lltoastalertpanel.h @@ -113,6 +113,7 @@ class LLToastAlertPanel LLFrameTimer mDefaultBtnTimer; // For Dialogs that take a line as text as input: LLLineEditor* mLineEditor; + LLHandle<LLView> mPreviouslyFocusedView; };