summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/lltoolfocus.cpp12
-rwxr-xr-xindra/newview/lltoolfocus.h1
-rwxr-xr-xindra/newview/lltoolgrab.cpp11
-rwxr-xr-xindra/newview/lltoolgrab.h1
-rwxr-xr-xindra/newview/lltoolpie.cpp11
5 files changed, 35 insertions, 1 deletions
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp
index ee4ec112f8..58073d1186 100755
--- a/indra/newview/lltoolfocus.cpp
+++ b/indra/newview/lltoolfocus.cpp
@@ -53,6 +53,7 @@
#include "llmorphview.h"
#include "llfloaterreg.h"
#include "llfloatercamera.h"
+#include "llmenugl.h"
// Globals
BOOL gCameraBtnZoom = TRUE;
@@ -75,6 +76,7 @@ LLToolCamera::LLToolCamera()
mOutsideSlopX(FALSE),
mOutsideSlopY(FALSE),
mValidClickPoint(FALSE),
+ mValidSelection(FALSE),
mMouseSteering(FALSE),
mMouseUpX(0),
mMouseUpY(0),
@@ -91,6 +93,8 @@ void LLToolCamera::handleSelect()
if (gFloaterTools)
{
gFloaterTools->setStatusText("camera");
+ // in case we start from tools floater, we count any selection as valid
+ mValidSelection = gFloaterTools->getVisible();
}
}
@@ -98,6 +102,14 @@ void LLToolCamera::handleSelect()
void LLToolCamera::handleDeselect()
{
// gAgent.setLookingAtAvatar(FALSE);
+
+ // Make sure that temporary selection won't pass anywhere except pie tool.
+ MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0;
+ if (!mValidSelection && (override_mask != MASK_NONE || (gFloaterTools && gFloaterTools->getVisible())))
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ LLSelectMgr::getInstance()->validateSelection();
+ }
}
BOOL LLToolCamera::handleMouseDown(S32 x, S32 y, MASK mask)
diff --git a/indra/newview/lltoolfocus.h b/indra/newview/lltoolfocus.h
index b1ac42e33f..d23eb2cce6 100755
--- a/indra/newview/lltoolfocus.h
+++ b/indra/newview/lltoolfocus.h
@@ -65,6 +65,7 @@ protected:
BOOL mOutsideSlopX;
BOOL mOutsideSlopY;
BOOL mValidClickPoint;
+ BOOL mValidSelection;
BOOL mMouseSteering;
S32 mMouseUpX; // needed for releaseMouse()
S32 mMouseUpY;
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index 9ac84e0066..fa6694b93b 100755
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -56,6 +56,7 @@
#include "llviewerregion.h"
#include "llvoavatarself.h"
#include "llworld.h"
+#include "llmenugl.h"
const S32 SLOP_DIST_SQ = 4;
@@ -98,6 +99,8 @@ void LLToolGrab::handleSelect()
{
// viewer can crash during startup if we don't check.
gFloaterTools->setStatusText("grab");
+ // in case we start from tools floater, we count any selection as valid
+ mValidSelection = gFloaterTools->getVisible();
}
gGrabBtnVertical = FALSE;
gGrabBtnSpin = FALSE;
@@ -110,6 +113,14 @@ void LLToolGrab::handleDeselect()
setMouseCapture( FALSE );
}
+ // Make sure that temporary(invalid) selection won't pass anywhere except pie tool.
+ MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0;
+ if (!mValidSelection && (override_mask != MASK_NONE || (gFloaterTools && gFloaterTools->getVisible())))
+ {
+ LLMenuGL::sMenuContainer->hideMenus();
+ LLSelectMgr::getInstance()->validateSelection();
+ }
+
}
BOOL LLToolGrab::handleDoubleClick(S32 x, S32 y, MASK mask)
diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h
index 5107716aab..4e22732124 100755
--- a/indra/newview/lltoolgrab.h
+++ b/indra/newview/lltoolgrab.h
@@ -119,6 +119,7 @@ private:
BOOL mHasMoved; // has mouse moved off center at all?
BOOL mOutsideSlop; // has mouse moved outside center 5 pixels?
BOOL mDeselectedThisClick;
+ BOOL mValidSelection;
S32 mLastFace;
LLVector2 mLastUVCoords;
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 959301b546..8191958dd4 100755
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -1311,7 +1311,16 @@ void LLToolPie::handleDeselect()
}
// remove temporary selection for pie menu
LLSelectMgr::getInstance()->setHoverObject(NULL);
- LLSelectMgr::getInstance()->validateSelection();
+
+ // Menu may be still up during transfer to different tool.
+ // toolfocus and toolgrab should retain menu, they will clear it if needed
+ MASK override_mask = gKeyboard ? gKeyboard->currentMask(TRUE) : 0;
+ if (!gMenuHolder->getVisible() || (override_mask & (MASK_ALT | MASK_CONTROL)) == 0)
+ {
+ // in most cases menu is useless without correct selection, so either keep both or discard both
+ gMenuHolder->hideMenus();
+ LLSelectMgr::getInstance()->validateSelection();
+ }
}
LLTool* LLToolPie::getOverrideTool(MASK mask)