Fix fullscreen origin on Mac OS X 10.4
authorSam Lantinga <slouken@libsdl.org>
Sat, 26 Feb 2011 11:59:33 -0800
changeset 5401ccaccc76a196
parent 5400 1df8b8a20191
child 5402 5d102cd8aef3
Fix fullscreen origin on Mac OS X 10.4
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Feb 26 11:29:23 2011 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Feb 26 11:59:33 2011 -0800
     1.3 @@ -823,6 +823,12 @@
     1.4          rect.size.height = bounds.h;
     1.5          ConvertNSRect(&rect);
     1.6  
     1.7 +        /* Hack to fix origin on Mac OS X 10.4 */
     1.8 +        NSRect screenRect = [[nswindow screen] frame];
     1.9 +        if (screenRect.size.height >= 1.0f) {
    1.10 +            rect.origin.y += (screenRect.size.height - rect.size.height);
    1.11 +        }
    1.12 +
    1.13          if ([nswindow respondsToSelector: @selector(setStyleMask:)]) {
    1.14              [nswindow performSelector: @selector(setStyleMask:) withObject: (id)NSBorderlessWindowMask];
    1.15          } else {