summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-11-13 00:11:53 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-10-13 16:27:36 +0300
commit38257221d090a8c2669d34a23891e7b66153df6f (patch)
tree113a169c33f240536f1e03d9e92ffece19fdd87c /indra/newview/llviewerwindow.cpp
parent46b4ea4d6d256fb644369d8701cc80944be44800 (diff)
viewer#3018 Expose mouse wrap in UI
And attempt some basic automation
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 3849c286c5..670a3b2939 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -3340,7 +3340,31 @@ void LLViewerWindow::clearPopups()
void LLViewerWindow::moveCursorToCenter()
{
- if (! gSavedSettings.getBOOL("DisableMouseWarp"))
+ bool mouse_warp = false;
+ LLCachedControl<S32> mouse_warp_mode(gSavedSettings, "MouseWarpMode", 1);
+
+ switch (mouse_warp_mode())
+ {
+ case 0:
+ // For Windows:
+ // Mouse usually uses 'delta' position since it isn't aware of own location, keep it centered.
+ // Touch screen reports absolute or virtual absolute position and warping a physical
+ // touch is pointless, so don't move it.
+ //
+ // MacOS
+ // If 'decoupled', CGAssociateMouseAndMouseCursorPosition can make mouse stay in
+ // one place and not move, do not move it (needs testing).
+ mouse_warp = mWindow->isWrapMouse();
+ break;
+ case 1:
+ mouse_warp = true;
+ break;
+ default:
+ mouse_warp = false;
+ break;
+ }
+
+ if (mouse_warp)
{
S32 x = getWorldViewWidthScaled() / 2;
S32 y = getWorldViewHeightScaled() / 2;