src/video/cocoa/SDL_cocoawindow.m
changeset 5406 1517da4ab6b1
parent 5404 6717e01acbe0
child 5466 006883d5fa51
--- a/src/video/cocoa/SDL_cocoawindow.m	Sun Feb 27 21:36:23 2011 -0800
+++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Feb 27 22:06:46 2011 -0800
@@ -302,15 +302,14 @@
 
 - (void)mouseMoved:(NSEvent *)theEvent
 {
+    SDL_Mouse *mouse = SDL_GetMouse();
     SDL_Window *window = _data->window;
     NSPoint point;
     int x, y;
 
-#ifdef RELATIVE_MOTION
-    if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
+    if (mouse->relative_mode) {
         return;
     }
-#endif
 
     point = [theEvent locationInWindow];
     x = (int)point.x;
@@ -861,19 +860,6 @@
 void
 Cocoa_SetWindowGrab(_THIS, SDL_Window * window)
 {
-#ifdef RELATIVE_MOTION
-    /* FIXME: work in progress
-        You set relative mode by using the following code in conjunction with
-        CGDisplayHideCursor(kCGDirectMainDisplay) and
-        CGDisplayShowCursor(kCGDirectMainDisplay)
-    */
-    if ((window->flags & SDL_WINDOW_INPUT_GRABBED) &&
-        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
-        CGAssociateMouseAndMouseCursorPosition(NO);
-    } else {
-        CGAssociateMouseAndMouseCursorPosition(YES);
-    }
-#else
     /* Move the cursor to the nearest point in the window */
     if ((window->flags & SDL_WINDOW_INPUT_GRABBED) &&
         (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
@@ -885,7 +871,6 @@
         cgpoint.y = window->y + y;
         CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
     }
-#endif
 }
 
 void