diff options
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 2 | ||||
-rwxr-xr-x | indra/llwindow/llwindowcallbacks.cpp | 4 | ||||
-rwxr-xr-x | indra/llwindow/llwindowcallbacks.h | 1 | ||||
-rwxr-xr-x | indra/llwindow/llwindowmacosx-objc.h | 2 | ||||
-rwxr-xr-x | indra/llwindow/llwindowmacosx-objc.mm | 5 | ||||
-rwxr-xr-x | indra/llwindow/llwindowmacosx.cpp | 24 |
6 files changed, 35 insertions, 3 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index f3b8dac844..ca502e0659 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -391,7 +391,7 @@ attributedStringInfo getSegments(NSAttributedString *str) NSPoint mPoint = [theEvent locationInWindow]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; - callMouseMoved(mMousePos, 0); + callMouseDragged(mMousePos, 0); } - (void) otherMouseDown:(NSEvent *)theEvent diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp index eadff8a6b4..d2afb3f91b 100755 --- a/indra/llwindow/llwindowcallbacks.cpp +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -112,6 +112,10 @@ void LLWindowCallbacks::handleMouseMove(LLWindow *window, const LLCoordGL pos, M { } +void LLWindowCallbacks::handleMouseDragged(LLWindow *window, const LLCoordGL pos, MASK mask) +{ +} + void LLWindowCallbacks::handleScrollWheel(LLWindow *window, S32 clicks) { } diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h index 7da5959700..6a7137e593 100755 --- a/indra/llwindow/llwindowcallbacks.h +++ b/indra/llwindow/llwindowcallbacks.h @@ -52,6 +52,7 @@ public: virtual BOOL handleActivate(LLWindow *window, BOOL activated); virtual BOOL handleActivateApp(LLWindow *window, BOOL activating); virtual void handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask); + virtual void handleMouseDragged(LLWindow *window, LLCoordGL pos, MASK mask); virtual void handleScrollWheel(LLWindow *window, S32 clicks); virtual void handleResize(LLWindow *window, S32 width, S32 height); virtual void handleFocus(LLWindow *window); diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index dc184b91fb..507d1239be 100755 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -92,6 +92,7 @@ void setCrossCursor(); void setNotAllowedCursor(); void hideNSCursor(); void showNSCursor(); +bool isCGCursorVisible(); void hideNSCursorTillMove(bool hide); void requestUserAttention(); long showAlert(std::string title, std::string text, int type); @@ -133,6 +134,7 @@ void callLeftMouseUp(float *pos, unsigned int mask); void callDoubleClick(float *pos, unsigned int mask); void callResize(unsigned int width, unsigned int height); void callMouseMoved(float *pos, unsigned int mask); +void callMouseDragged(float *pos, unsigned int mask); void callScrollMoved(float delta); void callMouseExit(); void callWindowFocus(); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 1a21bf8430..43ce9a2255 100755 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -163,6 +163,11 @@ void showNSCursor() [NSCursor unhide]; } +bool isCGCursorVisible() +{ + return CGCursorIsVisible(); +} + void hideNSCursorTillMove(bool hide) { [NSCursor setHiddenUntilMouseMoves:hide]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 0d41884462..c6bf93507a 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -343,6 +343,18 @@ void callMouseMoved(float *pos, MASK mask) //gWindowImplementation->getCallbacks()->handleScrollWheel(gWindowImplementation, 0); } +void callMouseDragged(float *pos, MASK mask) +{ + LLCoordGL outCoords; + outCoords.mX = ll_round(pos[0]); + outCoords.mY = ll_round(pos[1]); + float deltas[2]; + gWindowImplementation->getMouseDeltas(deltas); + outCoords.mX += deltas[0]; + outCoords.mY += deltas[1]; + gWindowImplementation->getCallbacks()->handleMouseDragged(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE)); +} + void callScrollMoved(float delta) { gWindowImplementation->getCallbacks()->handleScrollWheel(gWindowImplementation, delta); @@ -1445,8 +1457,16 @@ void LLWindowMacOSX::updateCursor() mNextCursor = UI_CURSOR_WORKING; } - if(mCurrentCursor == mNextCursor) - return; + if(mCurrentCursor == mNextCursor) + { + if(mCursorHidden && isCGCursorVisible()) + { + hideNSCursor(); + mHideCursorPermanent = TRUE; + adjustCursorDecouple(); + } + return; + } // RN: replace multi-drag cursors with single versions if (mNextCursor == UI_CURSOR_ARROWDRAGMULTI) |