Merge branch 'DRTVWR-588-maint-W' of https://github.com/secondlife/viewer

# Conflicts:
#	indra/llui/llfloater.cpp
#	indra/llui/llfloater.h
master
Ansariel 2024-03-27 10:37:47 +01:00
commit d022043653
4 changed files with 32 additions and 24 deletions

View File

@ -55,7 +55,7 @@ namespace LL
* ThreadPool listens for application shutdown messages on the "LLApp"
* LLEventPump. Call close() to shut down this ThreadPool early.
*/
void close();
virtual void close();
std::string getName() const { return mName; }
size_t getWidth() const { return mThreads.size(); }

View File

@ -541,7 +541,6 @@ void LLFloater::enableResizeCtrls(bool enable, bool width, bool height)
void LLFloater::destroy()
{
gFloaterView->onDestroyFloater(this);
// LLFloaterReg should be synchronized with "dead" floater to avoid returning dead instance before
// it was deleted via LLMortician::updateClass(). See EXT-8458.
LLFloaterReg::removeInstance(mInstanceName, mKey);
@ -2631,8 +2630,7 @@ LLFloaterView::LLFloaterView (const Params& p)
mSnapOffsetBottom(0),
mSnapOffsetChatBar(0),
mSnapOffsetLeft(0),
mSnapOffsetRight(0),
mFrontChild(NULL)
mSnapOffsetRight(0)
{
mSnapView = getHandle();
}
@ -2788,7 +2786,8 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore
if (!child)
return;
if (mFrontChild == child)
LLFloater* front_child = mFrontChildHandle.get();
if (front_child == child)
{
if (give_focus && child->canFocusStealFrontmost() && !gFocusMgr.childHasKeyboardFocus(child))
{
@ -2797,12 +2796,12 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore
return;
}
if (mFrontChild && !mFrontChild->isDead())
if (front_child && !front_child->isDead() && front_child->getVisible())
{
mFrontChild->goneFromFront();
front_child->goneFromFront();
}
mFrontChild = child;
mFrontChildHandle = child->getHandle();
// *TODO: make this respect floater's mAutoFocus value, instead of
// using parameter
@ -3389,7 +3388,8 @@ LLFloater *LLFloaterView::getBackmost() const
void LLFloaterView::syncFloaterTabOrder()
{
if (mFrontChild && !mFrontChild->isDead() && mFrontChild->getIsChrome())
LLFloater* front_child = mFrontChildHandle.get();
if (front_child && front_child->getIsChrome())
return;
// look for a visible modal dialog, starting from first
@ -3427,11 +3427,12 @@ void LLFloaterView::syncFloaterTabOrder()
LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it);
if (gFocusMgr.childHasKeyboardFocus(floaterp))
{
if (mFrontChild != floaterp)
LLFloater* front_child = mFrontChildHandle.get();
if (front_child != floaterp)
{
// Grab a list of the top floaters that want to stay on top of the focused floater
std::list<LLFloater*> listTop;
if (mFrontChild && !mFrontChild->canFocusStealFrontmost())
if (front_child && !front_child->canFocusStealFrontmost())
{
for (LLView* childp : *getChildList())
{
@ -3451,7 +3452,7 @@ void LLFloaterView::syncFloaterTabOrder()
{
sendChildToFront(childp);
}
mFrontChild = listTop.back();
mFrontChildHandle = listTop.back()->getHandle();
}
}
@ -3547,14 +3548,6 @@ void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LL
}
}
void LLFloaterView::onDestroyFloater(LLFloater* floater)
{
if (mFrontChild == floater)
{
mFrontChild = nullptr;
}
}
// <FS:Ansariel> Prevent floaters being dragged under main chat bar
void LLFloaterView::setMainChatbarRect(LLLayoutPanel* panel, const LLRect& chatbar_rect)
{

View File

@ -645,7 +645,6 @@ public:
// </FS:KC> Fix for bad edge snapping
void setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect);
void onDestroyFloater(LLFloater* floater);
// <FS:Ansariel> Prevent floaters being dragged under main chat bar
void setMainChatbarRect(LLLayoutPanel* panel, const LLRect& chatbar_rect);
@ -670,7 +669,7 @@ private:
S32 mMinimizePositionVOffset;
typedef std::vector<std::pair<LLHandle<LLFloater>, boost::signals2::connection> > hidden_floaters_t;
hidden_floaters_t mHiddenFloaters;
LLFloater * mFrontChild;
LLHandle<LLFloater> mFrontChildHandle;
// <FS:Ansariel> Prevent floaters being dragged under main chat bar
LLRect mMainChatbarRect;

View File

@ -351,6 +351,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
LLWindowWin32Thread();
void run() override;
void close() override;
// closes queue, wakes thread, waits until thread closes
void wakeAndDestroy();
@ -4672,11 +4673,25 @@ void LLWindowWin32::getWindowChrome( U32 &aChromeW, U32 &aChromeH )
#endif // LL_WINDOWS
inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread()
: LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, false)
: LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, true /*should be false, temporary workaround for SL-18721*/)
{
LL::ThreadPool::start();
}
void LLWindowWin32::LLWindowWin32Thread::close()
{
if (!mQueue->isClosed())
{
LL_WARNS() << "Closing window thread without using destroy_window_handler" << LL_ENDL;
LL::ThreadPool::close();
// Workaround for SL-18721 in case window closes too early and abruptly
LLSplashScreen::show();
LLSplashScreen::update("..."); // will be updated later
}
}
/**
* LogChange is to log changes in status while trying to avoid spamming the
* log with repeated messages, especially in a tight loop. It refuses to log
@ -5025,7 +5040,8 @@ void LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()
{
if (mQueue->isClosed())
{
LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." <<LL_ENDL;
LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." << LL_ENDL;
return;
}
// Make sure we don't leave a blank toolbar button.