src/video/cocoa/SDL_cocoawindow.m
changeset 3409 c8f580ebc96a
parent 3075 4c28a9655933
child 3414 1e45c3012a4f
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Wed Oct 21 14:51:42 2009 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Thu Oct 22 04:46:11 2009 +0000
     1.3 @@ -239,6 +239,15 @@
     1.4      mouse = SDL_GetMouse(index);
     1.5  
     1.6      point = [NSEvent mouseLocation];
     1.7 +    if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) {
     1.8 +        rect.size.width = CGDisplayPixelsWide(kCGDirectMainDisplay);
     1.9 +        rect.size.height = CGDisplayPixelsHigh(kCGDirectMainDisplay);
    1.10 +        point.y = rect.size.height - point.y;
    1.11 +    } else {
    1.12 +        rect = [_data->window contentRectForFrameRect:[_data->window frame]];
    1.13 +        point.x = point.x - rect.origin.x;
    1.14 +        point.y = rect.size.height - (point.y - rect.origin.y);
    1.15 +    }
    1.16      point.x = point.x - rect.origin.x;
    1.17      point.y = rect.size.height - (point.y - rect.origin.y);
    1.18      if ( point.x < 0 || point.x >= rect.size.width ||