diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 535202633e..c68b9a5e4b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -37,7 +37,6 @@ #include "llerrorcontrol.h" #include "lleventtimer.h" #include "llfile.h" -#include "llfloaternotificationstabbed.h" #include "llviewertexturelist.h" #include "llgroupmgr.h" #include "llagent.h" @@ -118,6 +117,9 @@ // [SL:KB] - Patch: Build-ScriptRecover | Checked: 2011-11-24 (Catznip-3.2.0) #include "llfloaterscriptrecover.h" // [/SL:KB] + +#include "llfloaternotificationstabbed.h" // FIRE-35118 - Add idle() processing to delete notifications + #include "llspellcheck.h" #include "llscenemonitor.h" #include "llavatarrenderinfoaccountant.h" @@ -5664,9 +5666,7 @@ void LLAppViewer::idle() } } - // Handle deferred notice deletions - LLFloaterNotificationsTabbed::getInstance()->idle(); - // + LLFloaterNotificationsTabbed::getInstance()->idle(); // Handle deferred notice deletions // Update layonts, handle mouse events, tooltips, e t c // updateUI() needs to be called even in case viewer disconected diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index 78ffcceada..89b7fc8288 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -359,63 +359,66 @@ void LLFloaterNotificationsTabbed::getAllItemsOnCurrentTab(std::vector void LLFloaterNotificationsTabbed::closeAllOnCurrentTab() { // Need to clear notification channel, to add storable toasts into the list. + + // FIRE-35118 Linden viewer just calls onItemClose() for each item + // which can turn into a lag event several seconds long. Firestorm will queue + // notificatsion UUIDs to close them one by one in the new idle() function below. mDeleteNotificationsTimer.reset(); + // clearScreenChannels(); std::vector items; getAllItemsOnCurrentTab(items); std::vector::iterator iter = items.begin(); for (; iter != items.end(); ++iter) - { // Linden viewer just calls onItemClose() for each item - // which can turn into a lag event several seconds long. Firestorm will queue - // notification UUIDs to close them one by one in the new idle() function. - - // Put all items into the FIFO to close them one by one + { LLNotificationListItem* notify_item = dynamic_cast(*iter); if (notify_item) - { // Save via UUID instead of pointers to avoid dangling pointers - const LLUUID id = notify_item->getID(); + // + // onItemClose(notify_item); + { // Put all items into the FIFO with UUID and type + LLUUID id = notify_item->getID(); if (id.notNull()) { - mToastsToGo.push(id); // Add UUID to back of queue + // Add UUID and key to back of queue + mNotificationsToGo.push( {id, notify_item->getNotificationName()} ); } } } LL_INFOS() << "Close all on current tab: " << mDeleteNotificationsTimer.getElapsedTimeF32() << " sec " - << " to queue " << mToastsToGo.size() << " notices to delete" << LL_ENDL; + << " to queue " << mNotificationsToGo.size() << " notices to delete" << LL_ENDL; } - //--------------------------------------------------------------------------------- -// Deferred deletion of notifications +// Firestorm Deferred deletion of notifications FIRE-35118 void LLFloaterNotificationsTabbed::idle() { - if (!mToastsToGo.empty()) + if (!mNotificationsToGo.empty()) { // If there are any toasts to close, close them one by one - LLUUID toast_id = mToastsToGo.front(); // FIFO queue - mToastsToGo.pop(); + std::pair pear = mNotificationsToGo.front(); // FIFO queue + mNotificationsToGo.pop(); - // Should just be "GroupNotice" but use the API to get the list of types - std::set notice_types = LLGroupNoticeNotificationListItem::getTypes(); - for (auto type_it = notice_types.begin(); type_it != notice_types.end(); ++type_it) - { // Find the group notice by ID - LLNotificationListItem* item = dynamic_cast(findItemByID(toast_id, *type_it)); - if (item) + // Find the notice by ID + LLNotificationListItem* item = dynamic_cast(findItemByID(pear.first, pear.second)); + if (item) + { + // LL_INFOS() << "Found deferred item to close: " << pear.first << " type " << pear.second << LL_ENDL; + onItemClose(item); + + if (mNotificationsToGo.empty()) { - // LL_INFOS() << "Found deferred item to close: " << toast_id << " type " << *type_it << LL_ENDL; - onItemClose(item); - - if (mToastsToGo.empty()) - { - LL_INFOS() << "Close all on current tab took " << mDeleteNotificationsTimer.getElapsedTimeF32() << " sec " - << " to delete all notices " << LL_ENDL; - } - break; + LL_INFOS() << "Close all on current tab took " << mDeleteNotificationsTimer.getElapsedTimeF32() << " sec " + << " to delete all notices " << LL_ENDL; } } + else + { + LL_WARNS() << "Unable to find deferred notification with ID: " << pear.first + << " key " << pear.second << LL_ENDL; + } + // } } -// //--------------------------------------------------------------------------------- void LLFloaterNotificationsTabbed::collapseAllOnCurrentTab() diff --git a/indra/newview/llfloaternotificationstabbed.h b/indra/newview/llfloaternotificationstabbed.h index f5b4f017a7..2980475525 100644 --- a/indra/newview/llfloaternotificationstabbed.h +++ b/indra/newview/llfloaternotificationstabbed.h @@ -98,9 +98,7 @@ public: void setSysWellChiclet(LLSysWellChiclet* chiclet); void closeAll(); - // Deferred deletion of notifications - void idle(); // for deferred deletion with "delete all" operation - // + void idle(); // FIRE-35118 Deferred deletion of notifications static LLFloaterNotificationsTabbed* getInstance(const LLSD& key = LLSD()); @@ -171,10 +169,11 @@ private: LLButton* mDeleteAllBtn; LLButton* mCollapseAllBtn; - // Deferred deletion of notifications - std::queue mToastsToGo; - LLTimer mDeleteNotificationsTimer; // only for logging, could be removed - // + // FIRE-35118 Deferred deletion of notifications + std::queue> mNotificationsToGo; + + LLTimer mDeleteNotificationsTimer; // only for logging, could be removed + // }; #endif // LL_FLOATERNOTIFICATIONSTABBED_H