summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2010-01-12 11:31:07 -0800
committerRick Pasetto <rick@lindenlab.com>2010-01-12 11:31:07 -0800
commitdf69302cd2f00dd44b5b34aeb3ba896ce7548556 (patch)
tree7595bf6c5b171e0c180bf75173ddf03c1d2fe344
parentb06d655727c15530c1f65ccea83ab911f42e04ff (diff)
Add restoring of previous cursor to mac impl
http://codereview.lindenlab.com/273045
-rw-r--r--indra/llwindow/llwindowmacosx.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 783d1f39ca..9ccd4c7f97 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -2797,8 +2797,14 @@ void LLWindowMacOSX::setCursor(ECursorType cursor)
{
OSStatus result = noErr;
- if (mDragOverrideCursor != -1) return;
-
+ if (mDragOverrideCursor != -1)
+ {
+ // A drag is in progress...remember the requested cursor and we'll
+ // restore it when it is done
+ mCurrentCursor = cursor;
+ return;
+ }
+
if (cursor == UI_CURSOR_ARROW
&& mBusyCount > 0)
{
@@ -3529,11 +3535,19 @@ OSErr LLWindowMacOSX::handleDragNDrop(DragRef drag, LLWindowCallbacks::DragNDrop
mDragOverrideCursor = -1;
break;
}
+ // This overrides the cursor being set by setCursor.
+ // This is a bit of a hack workaround because lots of areas
+ // within the viewer just blindly set the cursor.
if (mDragOverrideCursor == -1)
{
- SetThemeCursor(kThemeArrowCursor);
+ // Restore the cursor
+ ECursorType temp_cursor = mCurrentCursor;
+ // get around the "setting the same cursor" code in setCursor()
+ mCurrentCursor = UI_CURSOR_COUNT;
+ setCursor(temp_cursor);
}
else {
+ // Override the cursor
SetThemeCursor(mDragOverrideCursor);
}