comparison src/video/cocoa/SDL_cocoamodes.m @ 3136:962357f325e1 gsoc2009_IME

Further polish API, fix crash in test program.
author Jiang Jiang <gzjjgod@gmail.com>
date Thu, 06 Aug 2009 08:59:53 +0000
parents 99210400e8b9
children
comparison
equal deleted inserted replaced
3135:f4e553ec6a62 3136:962357f325e1
246 if (fade_token != kCGDisplayFadeReservationInvalidToken) { 246 if (fade_token != kCGDisplayFadeReservationInvalidToken) {
247 CGDisplayFade(fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE); 247 CGDisplayFade(fade_token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, FALSE);
248 CGReleaseDisplayFadeReservation(fade_token); 248 CGReleaseDisplayFadeReservation(fade_token);
249 } 249 }
250 250
251 NSRect frame = [[NSScreen mainScreen] frame];
252 NSLog(@"mainScreen frame: %gx%g", frame.size.width, frame.size.height);
253
254 [[NSApp mainWindow] makeKeyAndOrderFront: nil];
255
251 /* 256 /*
252 There is a bug in Cocoa where NSScreen doesn't synchronize 257 There is a bug in Cocoa where NSScreen doesn't synchronize
253 with CGDirectDisplay, so the main screen's frame is wrong. 258 with CGDirectDisplay, so the main screen's frame is wrong.
254 As a result, coordinate translation produces incorrect results. 259 As a result, coordinate translation produces incorrect results.
255 We can hack around this bug by setting the screen rect 260 We can hack around this bug by setting the screen rect