src/video/cocoa/SDL_cocoawindow.m
changeset 5406 1517da4ab6b1
parent 5404 6717e01acbe0
child 5466 006883d5fa51
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sun Feb 27 21:36:23 2011 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Feb 27 22:06:46 2011 -0800
     1.3 @@ -302,15 +302,14 @@
     1.4  
     1.5  - (void)mouseMoved:(NSEvent *)theEvent
     1.6  {
     1.7 +    SDL_Mouse *mouse = SDL_GetMouse();
     1.8      SDL_Window *window = _data->window;
     1.9      NSPoint point;
    1.10      int x, y;
    1.11  
    1.12 -#ifdef RELATIVE_MOTION
    1.13 -    if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
    1.14 +    if (mouse->relative_mode) {
    1.15          return;
    1.16      }
    1.17 -#endif
    1.18  
    1.19      point = [theEvent locationInWindow];
    1.20      x = (int)point.x;
    1.21 @@ -861,19 +860,6 @@
    1.22  void
    1.23  Cocoa_SetWindowGrab(_THIS, SDL_Window * window)
    1.24  {
    1.25 -#ifdef RELATIVE_MOTION
    1.26 -    /* FIXME: work in progress
    1.27 -        You set relative mode by using the following code in conjunction with
    1.28 -        CGDisplayHideCursor(kCGDirectMainDisplay) and
    1.29 -        CGDisplayShowCursor(kCGDirectMainDisplay)
    1.30 -    */
    1.31 -    if ((window->flags & SDL_WINDOW_INPUT_GRABBED) &&
    1.32 -        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    1.33 -        CGAssociateMouseAndMouseCursorPosition(NO);
    1.34 -    } else {
    1.35 -        CGAssociateMouseAndMouseCursorPosition(YES);
    1.36 -    }
    1.37 -#else
    1.38      /* Move the cursor to the nearest point in the window */
    1.39      if ((window->flags & SDL_WINDOW_INPUT_GRABBED) &&
    1.40          (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    1.41 @@ -885,7 +871,6 @@
    1.42          cgpoint.y = window->y + y;
    1.43          CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
    1.44      }
    1.45 -#endif
    1.46  }
    1.47  
    1.48  void