From 5553d614211998b5a10529f6b3ec68d2b25dc07a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 22 Oct 2021 17:01:33 +0000 Subject: SL-16203 Fix for wonky handling of mouse deltas. --- indra/llwindow/llwindowwin32.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/llwindow/llwindowwin32.h') diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 5f253b5df3..b44d458fc6 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -35,6 +35,7 @@ #include "lldragdropwin32.h" #include "llthread.h" #include "llthreadsafequeue.h" +#include "llmutex.h" // Hack for async host by name #define LL_WM_HOST_RESOLVED (WM_APP + 1) @@ -98,6 +99,7 @@ public: void destroySharedContext(void* context) override; /*virtual*/ BOOL setCursorPosition(LLCoordWindow position); /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position); + /*virtual*/ BOOL getCursorDelta(LLCoordCommon* delta); /*virtual*/ void showCursor(); /*virtual*/ void hideCursor(); /*virtual*/ void showCursorFromMouseMove(); @@ -221,6 +223,14 @@ protected: F32 mNativeAspectRatio; HCURSOR mCursor[ UI_CURSOR_COUNT ]; // Array of all mouse cursors + LLCoordWindow mCursorPosition; // mouse cursor position, should only be mutated on main thread + LLMutex mRawMouseMutex; + RAWINPUTDEVICE mRawMouse; + LLCoordWindow mLastCursorPosition; // mouse cursor position from previous frame + LLCoordCommon mRawMouseDelta; // raw mouse delta according to window thread + LLCoordCommon mMouseFrameDelta; // how much the mouse moved between the last two calls to gatherInput + + MASK mMouseMask; static BOOL sIsClassRegistered; // has the window class been registered? @@ -231,7 +241,6 @@ protected: BOOL mCustomGammaSet; LPWSTR mIconResource; - BOOL mMousePositionModified; BOOL mInputProcessingPaused; // The following variables are for Language Text Input control. @@ -261,7 +270,9 @@ protected: LLWindowWin32Thread* mWindowThread = nullptr; LLThreadSafeQueue> mFunctionQueue; + LLThreadSafeQueue> mMouseQueue; void post(const std::function& func); + void postMouseButtonEvent(const std::function& func); friend class LLWindowManager; friend class LLWindowWin32Thread; -- cgit v1.2.3