diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-06-19 19:18:35 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-06-19 20:20:38 +0300 |
commit | 30209314ac02cf5ac868b5207b684b9fadb706bb (patch) | |
tree | 27987bc94a25f5b01ddfef4431e33331323cbb3a /indra | |
parent | b5b0c174390b4158c69eeff7efd59c4f1615e491 (diff) |
SL-19686 Fix gallery causing lags
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llinventorygallery.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index cfaff512ff..347611dfe2 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -337,9 +337,16 @@ void LLInventoryGallery::draw() void LLInventoryGallery::onVisibilityChange(BOOL new_visibility) { - if (new_visibility && mRootDirty) + if (new_visibility) { - updateRootFolder(); + if (mRootDirty) + { + updateRootFolder(); + } + else if (mNeedsArrange) + { + gIdleCallbacks.addFunction(onIdle, (void*)this); + } } LLPanel::onVisibilityChange(new_visibility); } @@ -751,9 +758,10 @@ void LLInventoryGallery::onIdle(void* userdata) return; } + bool visible = self->getVisible(); // In visible chain? const F64 MAX_TIME_VISIBLE = 0.020f; const F64 MAX_TIME_HIDDEN = 0.001f; // take it slow - const F64 max_time = self->getVisible() ? MAX_TIME_VISIBLE : MAX_TIME_HIDDEN; + const F64 max_time = visible ? MAX_TIME_VISIBLE : MAX_TIME_HIDDEN; F64 curent_time = LLTimer::getTotalSeconds(); const F64 end_time = curent_time + max_time; @@ -766,7 +774,7 @@ void LLInventoryGallery::onIdle(void* userdata) curent_time = LLTimer::getTotalSeconds(); } - if (self->mNeedsArrange) + if (self->mNeedsArrange && visible) { self->mNeedsArrange = false; self->reArrangeRows(); |