Drag and drop 2.5 integration! Finally, slashdot regulars can use
[blender-staging.git] / source / blender / windowmanager / intern / wm_cursors.c
index 7decf7b2ed2c08d4cbf4c1380c5bd5a657e1f8f9..f23688404b1428df027a9f20fe7bc0e7279d92ca 100644 (file)
@@ -64,6 +64,7 @@ static GHOST_TStandardCursor convert_cursor(int curs)
                case CURSOR_X_MOVE:             return GHOST_kStandardCursorLeftRight;
                case CURSOR_Y_MOVE:             return GHOST_kStandardCursorUpDown;
                case CURSOR_PENCIL:             return GHOST_kStandardCursorPencil;
+               case CURSOR_COPY:               return GHOST_kStandardCursorCopy;
        }
 }
 
@@ -136,9 +137,10 @@ void WM_cursor_set(wmWindow *win, int curs)
 
 void WM_cursor_modal(wmWindow *win, int val)
 {
-       if(win->lastcursor == 0)
+       if(win->lastcursor == 0) {
                win->lastcursor = win->cursor;
-       WM_cursor_set(win, val);
+               WM_cursor_set(win, val);
+       }
 }
 
 void WM_cursor_restore(wmWindow *win)
@@ -180,6 +182,8 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
                                GHOST_SetCursorGrab(win->ghostwin, mode, bounds);
                        else if (tabletdata->Active == GHOST_kTabletModeNone)
                                GHOST_SetCursorGrab(win->ghostwin, mode, bounds);
+
+                       win->grabcursor = mode;
                }
        }
 }
@@ -187,8 +191,10 @@ void WM_cursor_grab(wmWindow *win, int wrap, int hide, int *bounds)
 void WM_cursor_ungrab(wmWindow *win)
 {
        if ((G.f & G_DEBUG) == 0) {
-               if(win && win->ghostwin)
+               if(win && win->ghostwin) {
                        GHOST_SetCursorGrab(win->ghostwin, GHOST_kGrabDisable, NULL);
+                       win->grabcursor = GHOST_kGrabDisable;
+               }
        }
 }
 
@@ -212,7 +218,7 @@ void WM_timecursor(wmWindow *win, int nr)
        unsigned char bitmap[16][2];
        int i, idx;
        
-       if(win->lastcursor != 0)
+       if(win->lastcursor == 0)
                win->lastcursor= win->cursor; 
        
        memset(&bitmap, 0x00, sizeof(bitmap));