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