Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
slouken committed Sep 5, 2009
1 parent 081ddde commit 4cce2bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/video/cocoa/SDL_cocoamodes.m
Expand Up @@ -23,6 +23,7 @@

#include "SDL_cocoavideo.h"

#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
/*
Add methods to get at private members of NSScreen.
Since there is a bug in Apple's screen switching code
Expand All @@ -40,6 +41,7 @@ - (void) setFrame:(NSRect)frame;
_frame = frame;
}
@end
#endif

static void
CG_SetError(const char *prefix, CGDisplayErr result)
Expand Down Expand Up @@ -248,6 +250,7 @@ - (void) setFrame:(NSRect)frame;
CGReleaseDisplayFadeReservation(fade_token);
}

#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
/*
There is a bug in Cocoa where NSScreen doesn't synchronize
with CGDirectDisplay, so the main screen's frame is wrong.
Expand All @@ -256,6 +259,7 @@ - (void) setFrame:(NSRect)frame;
ourselves. This hack should be removed if/when the bug is fixed.
*/
[[NSScreen mainScreen] setFrame:NSMakeRect(0,0,mode->w,mode->h)];
#endif

return 0;

Expand Down

0 comments on commit 4cce2bf

Please sign in to comment.