summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-09-07 20:17:26 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-09-08 21:05:06 +0300
commitc37498bb4017e89654c0687a3f84792ecb445c47 (patch)
treeebf9228a8df5a590f0df1090b854a9b8418ac4b1 /indra/newview/llviewerwindow.cpp
parentd5d5fd815f2833bdc968d35a213a12380ac0dec6 (diff)
#6243 Double RMB support
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp56
1 files changed, 55 insertions, 1 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 32af06cd0d..4735119cfc 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1042,6 +1042,14 @@ bool LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
mLeftMouseDown = down;
buttonname = "Left Double Click";
break;
+ case CLICK_DOUBLERIGHT:
+ mRightMouseDown = down;
+ buttonname = "Right Double Click";
+ break;
+ case CLICK_DOUBLEMIDDLE:
+ mMiddleMouseDown = down;
+ buttonname = "Middle Double Click";
+ break;
case CLICK_BUTTON4:
buttonname = "Button 4";
break;
@@ -1105,6 +1113,12 @@ bool LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
handlePieMenu(x, y, mask);
r = true;
}
+ else if (down && clicktype == CLICK_DOUBLERIGHT && gMenuHolder)
+ {
+ // UI doesn't support double right click at the moment, but world does
+ // Just close menus.
+ gMenuHolder->hideMenus();
+ }
return r;
}
@@ -1157,6 +1171,12 @@ bool LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK m
handlePieMenu(x, y, mask);
return true;
}
+ if (down && clicktype == CLICK_DOUBLERIGHT && gMenuHolder)
+ {
+ // UI doesn't support double right click at the moment, but world does
+ // Just close menus.
+ gMenuHolder->hideMenus();
+ }
// If we got this far on a down-click, it wasn't handled.
// Up-clicks, though, are always handled as far as the OS is concerned.
@@ -1180,7 +1200,7 @@ bool LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask
return gViewerInput.handleMouse(window, pos, mask, CLICK_LEFT, down);
}
-bool LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask)
+bool LLViewerWindow::handleLeftMouseDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask)
{
// try handling as a double-click first, then a single-click if that
// wasn't handled.
@@ -1192,6 +1212,40 @@ bool LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma
return handleMouseDown(window, pos, mask);
}
+bool LLViewerWindow::handleRightMouseDoubleClick(LLWindow* window, LLCoordGL pos, MASK mask)
+{
+ // try handling as a double-click first, then a single-click if that
+ // wasn't handled.
+ bool down = true;
+ if (gViewerInput.handleMouse(window, pos, mask, CLICK_DOUBLERIGHT, down))
+ {
+ return true;
+ }
+
+ // If right-double is bound, don't fall back to single-right menu behavior.
+ // Note that by default CLICK_RIGHT can't be bound.
+ const S32 mode = gViewerInput.getMode();
+ const bool has_double_right = gViewerInput.isMouseBindUsed(CLICK_DOUBLERIGHT, mask, mode);
+ if (has_double_right)
+ {
+ return true;
+ }
+
+ return handleRightMouseDown(window, pos, mask);
+}
+
+bool LLViewerWindow::handleMiddleMouseDoubleClick(LLWindow* window, LLCoordGL pos, MASK mask)
+{
+ // try handling as a double-click first, then a single-click if that
+ // wasn't handled.
+ bool down = true;
+ if (gViewerInput.handleMouse(window, pos, mask, CLICK_DOUBLEMIDDLE, down))
+ {
+ return true;
+ }
+ return handleMiddleMouseDown(window, pos, mask);
+}
+
bool LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask)
{
if (mMouseDownTimer.getStarted())