diff options
author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2024-09-13 08:02:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-13 08:02:04 +0300 |
commit | 1e1010bbf27c57d8d5ec6701d08df50c21bd11d0 (patch) | |
tree | eb3e48d624535b537dd26b3798acff669f39bfae /indra/newview/llviewerwindow.cpp | |
parent | a3f6f98f1b79e3d57ae67114db409297cd625310 (diff) | |
parent | e71215dcfdb960f64a7f10d2fba71790f8e7bcd1 (diff) |
Merge pull request #2545 for viewer#2529 Improve environment's performance
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1be80a5e02..0e7d82fd90 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()) { |