summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewerwindow.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 8ea8fbf905..e24fb35acb 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3888,7 +3888,9 @@ void LLViewerWindow::updateKeyboardFocus()
LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
if (cur_focus)
{
- if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain())
+ bool is_in_visible_chain = cur_focus->isInVisibleChain();
+ bool is_in_enabled_chain = cur_focus->isInEnabledChain();
+ if (!is_in_visible_chain || !is_in_enabled_chain)
{
// don't release focus, just reassign so that if being given
// to a sibling won't call onFocusLost on all the ancestors
@@ -3899,11 +3901,19 @@ void LLViewerWindow::updateKeyboardFocus()
bool new_focus_found = false;
while(parent)
{
+ if (!is_in_visible_chain)
+ {
+ is_in_visible_chain = parent->isInVisibleChain();
+ }
+ if (!is_in_enabled_chain)
+ {
+ is_in_enabled_chain = parent->isInEnabledChain();
+ }
if (parent->isCtrl()
&& (parent->hasTabStop() || parent == focus_root)
&& !parent->getIsChrome()
- && parent->isInVisibleChain()
- && parent->isInEnabledChain())
+ && is_in_visible_chain
+ && is_in_enabled_chain)
{
if (!parent->focusFirstItem())
{