Skip to content
Snippets Groups Projects
Commit f6f52d32 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

Provide a way for a floater to remain the topmost floater, even when focus is...

Provide a way for a floater to remain the topmost floater, even when focus is given to a different floater
parent 90e27299
No related branches found
No related tags found
No related merge requests found
...@@ -3039,7 +3039,29 @@ void LLFloaterView::syncFloaterTabOrder() ...@@ -3039,7 +3039,29 @@ void LLFloaterView::syncFloaterTabOrder()
LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it); LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it);
if (gFocusMgr.childHasKeyboardFocus(floaterp)) if (gFocusMgr.childHasKeyboardFocus(floaterp))
{ {
bringToFront(floaterp, FALSE); if (mFrontChild != floaterp)
{
// Grab a list of the top floaters that want to stay on top of the focused floater
std::list<LLView*> listTop;
if (mFrontChild && !mFrontChild->canFocusStealFrontmost())
{
for (LLView* childfloaterp : *getChildList())
{
if (static_cast<LLFloater*>(childfloaterp)->canFocusStealFrontmost())
break;
listTop.push_back(childfloaterp);
}
}
bringToFront(floaterp, FALSE);
// Restore top floaters
for (LLView* childp :listTop)
{
sendChildToFront(childp);
}
}
break; break;
} }
} }
......
...@@ -313,6 +313,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater> ...@@ -313,6 +313,9 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
/*virtual*/ void setVisible(BOOL visible); // do not override /*virtual*/ void setVisible(BOOL visible); // do not override
/*virtual*/ void onVisibilityChange ( BOOL new_visibility ); // do not override /*virtual*/ void onVisibilityChange ( BOOL new_visibility ); // do not override
bool canFocusStealFrontmost() const { return mFocusStealsFrontmost; }
void setFocusStealsFrontmost(bool wants_frontmost) { mFocusStealsFrontmost = wants_frontmost; }
void setFrontmost(BOOL take_focus = TRUE, BOOL restore = TRUE); void setFrontmost(BOOL take_focus = TRUE, BOOL restore = TRUE);
virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD()); virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD());
...@@ -478,6 +481,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater> ...@@ -478,6 +481,7 @@ class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
BOOL mCanTearOff; BOOL mCanTearOff;
BOOL mCanMinimize; BOOL mCanMinimize;
BOOL mCanClose; BOOL mCanClose;
bool mFocusStealsFrontmost = true; // FALSE if we don't want the currently focused floater to cover this floater without user interaction
BOOL mDragOnLeft; BOOL mDragOnLeft;
BOOL mResizable; BOOL mResizable;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment