summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolfocus.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolfocus.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/lltoolfocus.cpp33
1 files changed, 17 insertions, 16 deletions
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp
index a754d8ee7e..15f3c36674 100644..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;
@@ -60,7 +61,6 @@ BOOL gCameraBtnOrbit = FALSE;
BOOL gCameraBtnPan = FALSE;
const S32 SLOP_RANGE = 4;
-const F32 FOCUS_OFFSET_FACTOR = 1.f;
//
// Camera - shared functionality
@@ -75,6 +75,7 @@ LLToolCamera::LLToolCamera()
mOutsideSlopX(FALSE),
mOutsideSlopY(FALSE),
mValidClickPoint(FALSE),
+ mValidSelection(FALSE),
mMouseSteering(FALSE),
mMouseUpX(0),
mMouseUpY(0),
@@ -91,6 +92,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 +101,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)
@@ -124,7 +135,7 @@ BOOL LLToolCamera::handleMouseDown(S32 x, S32 y, MASK mask)
gViewerWindow->hideCursor();
- gViewerWindow->pickAsync(x, y, mask, pickCallback);
+ gViewerWindow->pickAsync(x, y, mask, pickCallback, FALSE, TRUE);
return TRUE;
}
@@ -314,8 +325,6 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
S32 dx = gViewerWindow->getCurrentMouseDX();
S32 dy = gViewerWindow->getCurrentMouseDY();
- BOOL moved_outside_slop = FALSE;
-
if (hasMouseCapture() && mValidClickPoint)
{
mAccumX += llabs(dx);
@@ -323,19 +332,11 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
if (mAccumX >= SLOP_RANGE)
{
- if (!mOutsideSlopX)
- {
- moved_outside_slop = TRUE;
- }
mOutsideSlopX = TRUE;
}
if (mAccumY >= SLOP_RANGE)
{
- if (!mOutsideSlopY)
- {
- moved_outside_slop = TRUE;
- }
mOutsideSlopY = TRUE;
}
}
@@ -344,7 +345,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
{
if (!mValidClickPoint)
{
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolFocus [invalid point]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolFocus [invalid point]" << LL_ENDL;
gViewerWindow->setCursor(UI_CURSOR_NO);
gViewerWindow->showCursor();
return TRUE;
@@ -371,7 +372,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolFocus [active]" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolFocus [active]" << LL_ENDL;
}
else if ( gCameraBtnPan ||
mask == MASK_PAN ||
@@ -399,7 +400,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolPan" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolPan" << LL_ENDL;
}
else if (gCameraBtnZoom)
{
@@ -431,7 +432,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask)
gViewerWindow->moveCursorToCenter();
}
- lldebugst(LLERR_USER_INPUT) << "hover handled by LLToolZoom" << llendl;
+ LL_DEBUGS("UserInput") << "hover handled by LLToolZoom" << LL_ENDL;
}
}