Adam Strzelecki to SDL
authorSam Lantinga <slouken@libsdl.org>
Fri, 23 Oct 2009 04:08:32 +0000
changeset 34141e45c3012a4f
parent 3413 4b1f10cfd304
child 3415 1756b9569141
Adam Strzelecki to SDL

I think something is wrong (look at the fix patch below):
(1) NSRect rect shouldn't be initialized with contentRectForFrameRect: at the top of the function, contentRectForFrameRect is called in non-fullscreen case anyway (1st @@)
(2) I think you've left two lines that should be removed completely (2nd @@)
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Oct 23 03:58:23 2009 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Oct 23 04:08:32 2009 +0000
     1.3 @@ -233,7 +233,7 @@
     1.4      int index;
     1.5      SDL_Mouse *mouse;
     1.6      NSPoint point;
     1.7 -    NSRect rect = [_data->window contentRectForFrameRect:[_data->window frame]];
     1.8 +    NSRect rect;
     1.9  
    1.10      index = _data->videodata->mouse;
    1.11      mouse = SDL_GetMouse(index);
    1.12 @@ -242,14 +242,12 @@
    1.13      if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) {
    1.14          rect.size.width = CGDisplayPixelsWide(kCGDirectMainDisplay);
    1.15          rect.size.height = CGDisplayPixelsHigh(kCGDirectMainDisplay);
    1.16 +        point.x = point.x - rect.origin.x;
    1.17          point.y = rect.size.height - point.y;
    1.18      } else {
    1.19          rect = [_data->window contentRectForFrameRect:[_data->window frame]];
    1.20 -        point.x = point.x - rect.origin.x;
    1.21          point.y = rect.size.height - (point.y - rect.origin.y);
    1.22      }
    1.23 -    point.x = point.x - rect.origin.x;
    1.24 -    point.y = rect.size.height - (point.y - rect.origin.y);
    1.25      if ( point.x < 0 || point.x >= rect.size.width ||
    1.26           point.y < 0 || point.y >= rect.size.height ) {
    1.27          if (mouse->focus != 0) {