summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-12-15 12:30:29 +0200
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-12-15 12:30:29 +0200
commit8a761993da9d8e7e8b0b8d0350c79c1e8c511e31 (patch)
treec3b7e96cf3c2b4f9f419ee64a0202842e27b6588 /indra
parent40699b96633e125846672c4639f04a05eb237712 (diff)
MAINT-957 Double-click Auto-pilot activates for clicks on UI elements, HUDs, some right-clicks
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/lltoolpie.cpp27
-rwxr-xr-xindra/newview/lltoolpie.h1
2 files changed, 25 insertions, 3 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index e400edec16..455a9951ac 100755
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -86,7 +86,8 @@ LLToolPie::LLToolPie()
mBlockClickToWalk(false),
mClickAction(0),
mClickActionBuyEnabled( gSavedSettings.getBOOL("ClickActionBuyEnabled") ),
- mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") )
+ mClickActionPayEnabled( gSavedSettings.getBOOL("ClickActionPayEnabled") ),
+ mDoubleClickTimer()
{
}
@@ -102,7 +103,12 @@ BOOL LLToolPie::handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktyp
BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask)
{
- mMouseOutsideSlop = FALSE;
+ if (mDoubleClickTimer.getStarted())
+ {
+ mDoubleClickTimer.stop();
+ }
+
+ mMouseOutsideSlop = FALSE;
mMouseDownX = x;
mMouseDownY = y;
@@ -644,7 +650,15 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
{
- LLViewerObject* obj = mPick.getObject();
+ if (!mDoubleClickTimer.getStarted())
+ {
+ mDoubleClickTimer.start();
+ }
+ else
+ {
+ mDoubleClickTimer.reset();
+ }
+ LLViewerObject* obj = mPick.getObject();
U8 click_action = final_click_action(obj);
// let media have first pass at click
@@ -738,6 +752,13 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
LL_INFOS() << "LLToolPie handleDoubleClick (becoming mouseDown)" << LL_ENDL;
}
+ if (!mDoubleClickTimer.getStarted() || (mDoubleClickTimer.getElapsedTimeF32() > 0.3f))
+ {
+ mDoubleClickTimer.stop();
+ return FALSE;
+ }
+ mDoubleClickTimer.stop();
+
if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
{
// We may be doing double click to walk, but we don't want to use a target on
diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h
index 68fe8bc4a5..6e9335251b 100755
--- a/indra/newview/lltoolpie.h
+++ b/indra/newview/lltoolpie.h
@@ -118,6 +118,7 @@ private:
LLSafeHandle<LLObjectSelection> mLeftClickSelection;
BOOL mClickActionBuyEnabled;
BOOL mClickActionPayEnabled;
+ LLFrameTimer mDoubleClickTimer;
};
#endif