From: Jjgod Jiang <gzjjgod@gmail.com>
authorSam Lantinga <slouken@libsdl.org>
Sat, 05 Sep 2009 09:54:45 +0000
changeset 3246c843261f74a4
parent 3245 d984d5bb17e9
child 3247 2dcfb4e07a57
From: Jjgod Jiang <gzjjgod@gmail.com>
Date: Sat, 5 Sep 2009 17:27:07 +0800

Disable NSScreen setFrame: hack in 10.6 since it no longer work
src/video/cocoa/SDL_cocoamodes.m
     1.1 --- a/src/video/cocoa/SDL_cocoamodes.m	Sat Sep 05 09:51:39 2009 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoamodes.m	Sat Sep 05 09:54:45 2009 +0000
     1.3 @@ -23,6 +23,7 @@
     1.4  
     1.5  #include "SDL_cocoavideo.h"
     1.6  
     1.7 +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
     1.8  /* 
     1.9      Add methods to get at private members of NSScreen. 
    1.10      Since there is a bug in Apple's screen switching code
    1.11 @@ -40,6 +41,7 @@
    1.12      _frame = frame;
    1.13  }
    1.14  @end
    1.15 +#endif
    1.16  
    1.17  static void
    1.18  CG_SetError(const char *prefix, CGDisplayErr result)
    1.19 @@ -248,6 +250,7 @@
    1.20          CGReleaseDisplayFadeReservation(fade_token);
    1.21      }
    1.22  
    1.23 +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
    1.24      /* 
    1.25          There is a bug in Cocoa where NSScreen doesn't synchronize
    1.26          with CGDirectDisplay, so the main screen's frame is wrong.
    1.27 @@ -256,6 +259,7 @@
    1.28          ourselves. This hack should be removed if/when the bug is fixed.
    1.29      */
    1.30      [[NSScreen mainScreen] setFrame:NSMakeRect(0,0,mode->w,mode->h)]; 
    1.31 +#endif
    1.32  
    1.33      return 0;
    1.34