STORM-1016 FIXED Crash after pressing ctrl-shift-w while there is an undocked sidepanel.
Reason: The shortcut closes all floaters, including those wrapping undocked sidepanels. The sidepanels get destroyed as well, while they are still referenced by the side tray. Fix: Dock (i.e. move to side tray) the sidepanel before its floater gets destroyed.meow-7.2.2
parent
5cb2d63979
commit
c077250ff1
|
|
@ -2865,7 +2865,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
|
|||
// close callback
|
||||
if (p.close_callback.isProvided())
|
||||
{
|
||||
mCloseSignal.connect(initCommitCallback(p.close_callback));
|
||||
setCloseCallback(initCommitCallback(p.close_callback));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2875,6 +2875,11 @@ boost::signals2::connection LLFloater::setMinimizeCallback( const commit_signal_
|
|||
return mMinimizeSignal->connect(cb);
|
||||
}
|
||||
|
||||
boost::signals2::connection LLFloater::setCloseCallback( const commit_signal_t::slot_type& cb )
|
||||
{
|
||||
return mCloseSignal.connect(cb);
|
||||
}
|
||||
|
||||
LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build");
|
||||
|
||||
bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node)
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ public:
|
|||
bool buildFromFile(const std::string &filename, LLXMLNodePtr output_node = NULL);
|
||||
|
||||
boost::signals2::connection setMinimizeCallback( const commit_signal_t::slot_type& cb );
|
||||
boost::signals2::connection setCloseCallback( const commit_signal_t::slot_type& cb );
|
||||
|
||||
void initFromParams(const LLFloater::Params& p);
|
||||
bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ bool LLSideTray::instanceCreated ()
|
|||
|
||||
class LLSideTrayTab: public LLPanel
|
||||
{
|
||||
LOG_CLASS(LLSideTrayTab);
|
||||
friend class LLUICtrlFactory;
|
||||
friend class LLSideTray;
|
||||
public:
|
||||
|
|
@ -122,6 +123,8 @@ protected:
|
|||
void undock(LLFloater* floater_tab);
|
||||
|
||||
LLSideTray* getSideTray();
|
||||
|
||||
void onFloaterClose(LLSD::Boolean app_quitting);
|
||||
|
||||
public:
|
||||
virtual ~LLSideTrayTab();
|
||||
|
|
@ -140,6 +143,8 @@ public:
|
|||
void onOpen (const LLSD& key);
|
||||
|
||||
void toggleTabDocked();
|
||||
void setDocked(bool dock);
|
||||
bool isDocked() const;
|
||||
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
||||
|
|
@ -151,6 +156,7 @@ private:
|
|||
std::string mDescription;
|
||||
|
||||
LLView* mMainPanel;
|
||||
boost::signals2::connection mFloaterCloseConn;
|
||||
};
|
||||
|
||||
LLSideTrayTab::LLSideTrayTab(const Params& p)
|
||||
|
|
@ -271,6 +277,35 @@ void LLSideTrayTab::toggleTabDocked()
|
|||
LLFloaterReg::toggleInstance("side_bar_tab", tab_name);
|
||||
}
|
||||
|
||||
// Same as toggleTabDocked() apart from making sure that we do exactly what we want.
|
||||
void LLSideTrayTab::setDocked(bool dock)
|
||||
{
|
||||
if (isDocked() == dock)
|
||||
{
|
||||
llwarns << "Tab " << getName() << " is already " << (dock ? "docked" : "undocked") << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
toggleTabDocked();
|
||||
}
|
||||
|
||||
bool LLSideTrayTab::isDocked() const
|
||||
{
|
||||
return dynamic_cast<LLSideTray*>(getParent()) != NULL;
|
||||
}
|
||||
|
||||
void LLSideTrayTab::onFloaterClose(LLSD::Boolean app_quitting)
|
||||
{
|
||||
// If user presses Ctrl-Shift-W, handle that gracefully by docking all
|
||||
// undocked tabs before their floaters get destroyed (STORM-1016).
|
||||
|
||||
// Don't dock on quit for the current dock state to be correctly saved.
|
||||
if (app_quitting) return;
|
||||
|
||||
lldebugs << "Forcibly docking tab " << getName() << llendl;
|
||||
setDocked(true);
|
||||
}
|
||||
|
||||
BOOL LLSideTrayTab::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
// Let children handle the event
|
||||
|
|
@ -294,6 +329,7 @@ void LLSideTrayTab::dock(LLFloater* floater_tab)
|
|||
return;
|
||||
}
|
||||
|
||||
mFloaterCloseConn.disconnect();
|
||||
setRect(side_tray->getLocalRect());
|
||||
reshape(getRect().getWidth(), getRect().getHeight());
|
||||
|
||||
|
|
@ -342,6 +378,7 @@ void LLSideTrayTab::undock(LLFloater* floater_tab)
|
|||
}
|
||||
|
||||
floater_tab->addChild(this);
|
||||
mFloaterCloseConn = floater_tab->setCloseCallback(boost::bind(&LLSideTrayTab::onFloaterClose, this, _2));
|
||||
floater_tab->setTitle(mTabTitle);
|
||||
floater_tab->setName(getName());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue