summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-10-21 04:47:55 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-10-21 04:47:55 +0000
commit2c1aacf814142b23049eff2a691a7cd2902bcf1d (patch)
tree21d9890a07996bfa983a094f1003b6f8a0277332
parent044557a853ba70bfa80392b48936523528abda5f (diff)
Merging revisions 2102-2104 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry
* Bugs: EXT-1609 EXT-1255 EXT-1299
-rw-r--r--indra/llui/CMakeLists.txt2
-rw-r--r--indra/llui/lldockablefloater.cpp12
-rw-r--r--indra/llui/lldockablefloater.h2
-rw-r--r--indra/llui/lldockcontrol.h4
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llfloatercamera.cpp4
-rw-r--r--indra/newview/llfloatercamera.h6
-rw-r--r--indra/newview/llimfloater.cpp9
-rw-r--r--indra/newview/llimfloater.h4
-rw-r--r--indra/newview/llmoveview.cpp4
-rw-r--r--indra/newview/llmoveview.h4
-rw-r--r--indra/newview/llpanellandmarks.cpp4
-rw-r--r--indra/newview/llrootview.h22
-rw-r--r--indra/newview/llsyswellwindow.cpp4
-rw-r--r--indra/newview/lltransientdockablefloater.cpp96
-rw-r--r--indra/newview/lltransientdockablefloater.h57
-rw-r--r--indra/newview/lltransientfloatermgr.cpp110
-rw-r--r--indra/newview/lltransientfloatermgr.h63
18 files changed, 392 insertions, 19 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt
index d9169f57f9..f4d1284095 100644
--- a/indra/llui/CMakeLists.txt
+++ b/indra/llui/CMakeLists.txt
@@ -86,7 +86,6 @@ set(llui_SOURCE_FILES
lltextbox.cpp
lltexteditor.cpp
lltextparser.cpp
- lltransientfloatermgr.cpp
lltransutil.cpp
lltoggleablemenu.cpp
lltooltip.cpp
@@ -176,7 +175,6 @@ set(llui_HEADER_FILES
lltextparser.h
lltoggleablemenu.h
lltooltip.h
- lltransientfloatermgr.h
lltransutil.h
lluicolortable.h
lluiconstants.h
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index 228d0e701f..35b3e486af 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -99,7 +99,7 @@ void LLDockableFloater::toggleInstance(const LLSD& sdname)
{
instance->setMinimized(FALSE);
instance->setVisible(TRUE);
- instance->setFocus(TRUE);
+ gFloaterView->bringToFront(instance);
}
}
@@ -141,6 +141,16 @@ void LLDockableFloater::setMinimized(BOOL minimize)
LLFloater::setMinimized(minimize);
}
+LLView * LLDockableFloater::getDockWidget()
+{
+ LLView * res = NULL;
+ if (getDockControl() != NULL) {
+ res = getDockControl()->getDock();
+ }
+
+ return res;
+}
+
void LLDockableFloater::onDockHidden()
{
setCanDock(FALSE);
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index 499ce9ae8d..46491d8a29 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -78,6 +78,8 @@ public:
*/
/*virtual*/ void setMinimized(BOOL minimize);
+ LLView * getDockWidget();
+
virtual void onDockHidden();
virtual void onDockShown();
diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h
index e8ffcac0ac..756a2900d3 100644
--- a/indra/llui/lldockcontrol.h
+++ b/indra/llui/lldockcontrol.h
@@ -63,6 +63,10 @@ public:
void on();
void off();
void setDock(LLView* dockWidget);
+ LLView* getDock()
+ {
+ return mDockWidget;
+ }
void repositionDockable();
void drawToungue();
bool isDockVisible();
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index d0f4dc88e7..df20651362 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -412,6 +412,8 @@ set(viewer_SOURCE_FILES
lltoolselectland.cpp
lltoolselectrect.cpp
lltracker.cpp
+ lltransientdockablefloater.cpp
+ lltransientfloatermgr.cpp
lluploaddialog.cpp
llurl.cpp
llurldispatcher.cpp
@@ -878,6 +880,8 @@ set(viewer_HEADER_FILES
lltoolselectland.h
lltoolselectrect.h
lltracker.h
+ lltransientdockablefloater.h
+ lltransientfloatermgr.h
lluiconstants.h
lluploaddialog.h
llurl.h
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index 551853592b..fc661772a6 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -133,7 +133,7 @@ void LLFloaterCamera::onClose(bool app_quitting)
}
LLFloaterCamera::LLFloaterCamera(const LLSD& val)
-: LLDockableFloater(NULL, val),
+: LLTransientDockableFloater(NULL, true, val),
mCurrMode(CAMERA_CTRL_MODE_ORBIT),
mPrevMode(CAMERA_CTRL_MODE_ORBIT)
{
@@ -292,7 +292,7 @@ void LLFloaterCamera::updateState()
//-------------LLFloaterCameraPresets------------------------
LLFloaterCameraPresets::LLFloaterCameraPresets(const LLSD& key):
-LLDockableFloater(NULL, key)
+LLTransientDockableFloater(NULL, true, key)
{}
BOOL LLFloaterCameraPresets::postBuild()
diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h
index 30a6b552f2..ba943e66ed 100644
--- a/indra/newview/llfloatercamera.h
+++ b/indra/newview/llfloatercamera.h
@@ -33,7 +33,7 @@
#ifndef LLFLOATERCAMERA_H
#define LLFLOATERCAMERA_H
-#include "lldockablefloater.h"
+#include "lltransientdockablefloater.h"
class LLJoystickCameraRotate;
class LLJoystickCameraZoom;
@@ -49,7 +49,7 @@ enum ECameraControlMode
};
class LLFloaterCamera
- : public LLDockableFloater
+ : public LLTransientDockableFloater
{
friend class LLFloaterReg;
@@ -112,7 +112,7 @@ private:
};
-class LLFloaterCameraPresets : public LLDockableFloater
+class LLFloaterCameraPresets : public LLTransientDockableFloater
{
friend class LLFloaterReg;
public:
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index a35c04440b..452943007d 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -55,7 +55,7 @@
LLIMFloater::LLIMFloater(const LLUUID& session_id)
- : LLDockableFloater(NULL, session_id),
+ : LLTransientDockableFloater(NULL, true, session_id),
mControlPanel(NULL),
mSessionID(session_id),
mLastMessageIndex(-1),
@@ -81,8 +81,6 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id)
mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelGroupControl, this);
}
}
-
- LLTransientFloaterMgr::getInstance()->registerTransientFloater(this);
}
// virtual
@@ -163,7 +161,6 @@ void LLIMFloater::sendMsg()
LLIMFloater::~LLIMFloater()
{
- LLTransientFloaterMgr::getInstance()->unregisterTransientFloater(this);
}
//virtual
@@ -297,7 +294,7 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
(LLNotificationsUI::LLChannelManager::getInstance()->
findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
- LLDockableFloater::setDocked(docked, pop_on_undock);
+ LLTransientDockableFloater::setDocked(docked, pop_on_undock);
// update notification channel state
if(channel)
@@ -311,7 +308,7 @@ void LLIMFloater::setVisible(BOOL visible)
LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>
(LLNotificationsUI::LLChannelManager::getInstance()->
findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
- LLDockableFloater::setVisible(visible);
+ LLTransientDockableFloater::setVisible(visible);
// update notification channel state
if(channel)
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 9b519ee7e3..e2f59c3507 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -33,7 +33,7 @@
#ifndef LL_IMFLOATER_H
#define LL_IMFLOATER_H
-#include "lldockablefloater.h"
+#include "lltransientdockablefloater.h"
#include "lllogchat.h"
class LLLineEditor;
@@ -45,7 +45,7 @@ class LLViewerTextEditor;
* Individual IM window that appears at the bottom of the screen,
* optionally "docked" to the bottom tray.
*/
-class LLIMFloater : public LLDockableFloater
+class LLIMFloater : public LLTransientDockableFloater
{
public:
LLIMFloater(const LLUUID& session_id);
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 1bbcc3f98e..4fc552c8b1 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -70,7 +70,7 @@ const std::string BOTTOM_TRAY_BUTTON_NAME = "movement_btn";
// protected
LLFloaterMove::LLFloaterMove(const LLSD& key)
-: LLDockableFloater(NULL, key),
+: LLTransientDockableFloater(NULL, true, key),
mForwardButton(NULL),
mBackwardButton(NULL),
mTurnLeftButton(NULL),
@@ -499,6 +499,8 @@ void LLFloaterMove::setDocked(bool docked, bool pop_on_undock/* = true*/)
LLDockableFloater::setDocked(docked, pop_on_undock);
bool show_mode_buttons = isDocked() || !gAgent.getFlying();
updateHeight(show_mode_buttons);
+
+ LLTransientDockableFloater::setDocked(docked, pop_on_undock);
}
void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode)
diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h
index cbed36f10d..cee6078ee9 100644
--- a/indra/newview/llmoveview.h
+++ b/indra/newview/llmoveview.h
@@ -34,7 +34,7 @@
#define LL_LLMOVEVIEW_H
// Library includes
-#include "lldockablefloater.h"
+#include "lltransientdockablefloater.h"
class LLButton;
class LLJoystickAgentTurn;
@@ -44,7 +44,7 @@ class LLJoystickAgentSlide;
// Classes
//
class LLFloaterMove
-: public LLDockableFloater
+: public LLTransientDockableFloater
{
friend class LLFloaterReg;
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 9f029e24e7..93e58f3441 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -388,6 +388,10 @@ void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_lis
root_folder->setupMenuHandle(LLInventoryType::IT_CATEGORY, mGearFolderMenu->getHandle());
root_folder->setupMenuHandle(LLInventoryType::IT_LANDMARK, mGearLandmarkMenu->getHandle());
}
+
+ // save initial folder state to avoid incorrect work while switching between Landmarks & Teleport History tabs
+ // See EXT-1609.
+ inventory_list->saveFolderState();
}
void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list)
diff --git a/indra/newview/llrootview.h b/indra/newview/llrootview.h
index f704fecddd..760b1a7a4c 100644
--- a/indra/newview/llrootview.h
+++ b/indra/newview/llrootview.h
@@ -47,5 +47,27 @@ public:
LLRootView(const Params& p)
: LLView(p)
{}
+
+ // added to provide possibility to handle mouse click event inside all application
+ // window without creating any floater
+ typedef boost::signals2::signal<void(S32 x, S32 y, MASK mask)>
+ mouse_signal_t;
+
+ private:
+ mouse_signal_t mMouseDownSignal;
+
+ public:
+ /*virtual*/
+ BOOL handleMouseDown(S32 x, S32 y, MASK mask)
+ {
+ mMouseDownSignal(x, y, mask);
+ return LLView::handleMouseDown(x, y, mask);
+ }
+
+ boost::signals2::connection addMouseDownCallback(
+ const mouse_signal_t::slot_type& cb)
+ {
+ return mMouseDownSignal.connect(cb);
+ }
};
#endif //LL_LLROOTVIEW_H
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 6714fe908f..9729281bac 100644
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -246,6 +246,10 @@ void LLSysWellWindow::toggleWindow()
if(!getVisible() || isMinimized())
{
+ if(mChannel)
+ {
+ mChannel->removeAndStoreAllStorableToasts();
+ }
if(isWindowEmpty())
{
return;
diff --git a/indra/newview/lltransientdockablefloater.cpp b/indra/newview/lltransientdockablefloater.cpp
new file mode 100644
index 0000000000..7e4d4988d1
--- /dev/null
+++ b/indra/newview/lltransientdockablefloater.cpp
@@ -0,0 +1,96 @@
+/**
+ * @file lltransientdockablefloater.cpp
+ * @brief Creates a panel of a specific kind for a toast
+ *
+ * $LicenseInfo:firstyear=2000&license=viewergpl$
+ *
+ * Copyright (c) 2000-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "lltransientfloatermgr.h"
+#include "lltransientdockablefloater.h"
+#include "llfloaterreg.h"
+
+
+LLTransientDockableFloater::LLTransientDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
+ const LLSD& key, const Params& params) :
+ LLDockableFloater(dockControl, uniqueDocking, key, params)
+{
+ LLTransientFloaterMgr::getInstance()->registerTransientFloater(this);
+}
+
+LLTransientDockableFloater::~LLTransientDockableFloater()
+{
+ LLTransientFloaterMgr::getInstance()->unregisterTransientFloater(this);
+}
+
+void LLTransientDockableFloater::setVisible(BOOL visible)
+{
+ LLView* dock = getDockWidget();
+ if(visible && isDocked())
+ {
+ LLTransientFloaterMgr::getInstance()->addControlView(this);
+ if (dock != NULL)
+ {
+ LLTransientFloaterMgr::getInstance()->addControlView(dock);
+ }
+ }
+ else
+ {
+ LLTransientFloaterMgr::getInstance()->removeControlView(this);
+ if (dock != NULL)
+ {
+ LLTransientFloaterMgr::getInstance()->removeControlView(dock);
+ }
+ }
+
+ LLDockableFloater::setVisible(visible);
+}
+
+void LLTransientDockableFloater::setDocked(bool docked, bool pop_on_undock)
+{
+ LLView* dock = getDockWidget();
+ if(docked)
+ {
+ LLTransientFloaterMgr::getInstance()->addControlView(this);
+ if (dock != NULL)
+ {
+ LLTransientFloaterMgr::getInstance()->addControlView(dock);
+ }
+ }
+ else
+ {
+ LLTransientFloaterMgr::getInstance()->removeControlView(this);
+ if (dock != NULL)
+ {
+ LLTransientFloaterMgr::getInstance()->removeControlView(dock);
+ }
+ }
+
+ LLDockableFloater::setDocked(docked, pop_on_undock);
+}
diff --git a/indra/newview/lltransientdockablefloater.h b/indra/newview/lltransientdockablefloater.h
new file mode 100644
index 0000000000..6e8a3afd22
--- /dev/null
+++ b/indra/newview/lltransientdockablefloater.h
@@ -0,0 +1,57 @@
+/**
+ * @file lltransientdockablefloater.h
+ * @brief Creates a panel of a specific kind for a toast.
+ *
+ * $LicenseInfo:firstyear=2003&license=viewergpl$
+ *
+ * Copyright (c) 2003-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_TRANSIENTDOCKABLEFLOATER_H
+#define LL_TRANSIENTDOCKABLEFLOATER_H
+
+#include "llerror.h"
+#include "llfloater.h"
+#include "lldockcontrol.h"
+#include "lldockablefloater.h"
+
+/**
+ * Represents floater that can dock and managed by transient floater manager.
+ * Transient floaters should be hidden if user click anywhere except defined view list.
+ */
+class LLTransientDockableFloater : public LLDockableFloater
+{
+public:
+ LOG_CLASS(LLTransientDockableFloater);
+ LLTransientDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
+ const LLSD& key, const Params& params = getDefaultParams());
+ virtual ~LLTransientDockableFloater();
+
+ /*virtual*/ void setVisible(BOOL visible);
+ /* virtual */void setDocked(bool docked, bool pop_on_undock = true);
+};
+
+#endif /* LL_TRANSIENTDOCKABLEFLOATER_H */
diff --git a/indra/newview/lltransientfloatermgr.cpp b/indra/newview/lltransientfloatermgr.cpp
new file mode 100644
index 0000000000..7befb87248
--- /dev/null
+++ b/indra/newview/lltransientfloatermgr.cpp
@@ -0,0 +1,110 @@
+/**
+ * @file lltransientfloatermgr.cpp
+ * @brief LLFocusMgr base class
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ *
+ * Copyright (c) 2002-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "lltransientfloatermgr.h"
+#include "llfocusmgr.h"
+#include "llrootview.h"
+#include "llviewerwindow.h"
+#include "lldockablefloater.h"
+
+
+LLTransientFloaterMgr::LLTransientFloaterMgr()
+{
+ gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(
+ &LLTransientFloaterMgr::leftMouseClickCallback, this, _1, _2, _3));
+}
+
+void LLTransientFloaterMgr::registerTransientFloater(LLFloater* floater)
+{
+ mTransSet.insert(floater);
+}
+
+void LLTransientFloaterMgr::unregisterTransientFloater(LLFloater* floater)
+{
+ mTransSet.erase(floater);
+}
+
+void LLTransientFloaterMgr::addControlView(LLView* view)
+{
+ mControlsSet.insert(view);
+}
+
+void LLTransientFloaterMgr::removeControlView(LLView* view)
+{
+ // we will still get focus lost callbacks on this view, but that's ok
+ // since we run sanity checking logic every time
+ mControlsSet.erase(view);
+}
+
+void LLTransientFloaterMgr::hideTransientFloaters()
+{
+ for (std::set<LLFloater*>::iterator it = mTransSet.begin(); it
+ != mTransSet.end(); it++)
+ {
+ LLFloater* floater = *it;
+ if (floater->isDocked())
+ {
+ floater->setVisible(FALSE);
+ }
+ }
+}
+
+void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y,
+ MASK mask)
+{
+ bool hide = true;
+ for (controls_set_t::iterator it = mControlsSet.begin(); it
+ != mControlsSet.end(); it++)
+ {
+ LLView* control_view = *it;
+ if (!control_view->getVisible())
+ {
+ continue;
+ }
+
+ LLRect rect = control_view->calcScreenRect();
+ // if click inside view rect
+ if (rect.pointInRect(x, y))
+ {
+ hide = false;
+ break;
+ }
+ }
+
+ if (hide)
+ {
+ hideTransientFloaters();
+ }
+}
+
diff --git a/indra/newview/lltransientfloatermgr.h b/indra/newview/lltransientfloatermgr.h
new file mode 100644
index 0000000000..cef6e1fe45
--- /dev/null
+++ b/indra/newview/lltransientfloatermgr.h
@@ -0,0 +1,63 @@
+/**
+ * @file lltransientfloatermgr.h
+ * @brief LLFocusMgr base class
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ *
+ * Copyright (c) 2002-2009, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLTRANSIENTFLOATERMGR_H
+#define LL_LLTRANSIENTFLOATERMGR_H
+
+#include "llui.h"
+#include "llsingleton.h"
+#include "llfloater.h"
+
+
+/**
+ * Provides functionality to hide transient floaters.
+ */
+class LLTransientFloaterMgr: public LLSingleton<LLTransientFloaterMgr>
+{
+public:
+ LLTransientFloaterMgr();
+ void registerTransientFloater(LLFloater* floater);
+ void unregisterTransientFloater(LLFloater* floater);
+ void addControlView(LLView* view);
+ void removeControlView(LLView* view);
+
+private:
+ void hideTransientFloaters();
+ void leftMouseClickCallback(S32 x, S32 y, MASK mask);
+
+private:
+ std::set<LLFloater*> mTransSet;
+ typedef std::set<LLView*> controls_set_t;
+ controls_set_t mControlsSet;
+};
+
+#endif // LL_LLTRANSIENTFLOATERMGR_H