diff options
| author | Callum Prentice <callum@lindenlab.com> | 2025-10-20 10:25:50 -0700 |
|---|---|---|
| committer | Callum Prentice <callum@lindenlab.com> | 2025-10-20 10:25:50 -0700 |
| commit | c64c16a59ae2220b29ba0ed1f3f22da07e694612 (patch) | |
| tree | 715e1ce1c6049469cffc27bcb0c8b636433539e5 /indra/newview/llviewerwindow.cpp | |
| parent | 53d83104522fc683126ba764b3e2101dc7442547 (diff) | |
| parent | 03690724188cb3fef1c2efed0f5626c93096ec2d (diff) | |
Merge branch 'develop' of https://github.com/secondlife/viewer into callum/voice-moderation-2
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 26 |
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; |
