src/video/cocoa/SDL_cocoawindow.m
changeset 3525 455a6c47d2c6
parent 3517 e7eec78e4b92
child 3528 59ff7a2beb57
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Dec 05 19:46:24 2009 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Dec 05 19:57:49 2009 +0000
     1.3 @@ -384,7 +384,7 @@
     1.4      NSString *title;
     1.5      int status;
     1.6  
     1.7 -    rect = CGDisplayBounds(displaydata->display);
     1.8 +    rect = Cocoa_DisplayBounds(displaydata->display);
     1.9      if ((window->flags & SDL_WINDOW_FULLSCREEN)
    1.10          || window->x == SDL_WINDOWPOS_CENTERED) {
    1.11          rect.origin.x += (rect.size.width - window->w) / 2;
    1.12 @@ -414,7 +414,9 @@
    1.13      NSArray *screens = [NSScreen screens];
    1.14      NSScreen *screen = nil;
    1.15      NSScreen *candidate;
    1.16 -    for (candidate in screens) {
    1.17 +    int i, count = [screens count];
    1.18 +    for (i = 0; i < count; ++i) {
    1.19 +        screen = [screens objectAtIndex:i];
    1.20          NSRect screenRect = [candidate frame];
    1.21          if (rect.origin.x >= screenRect.origin.x &&
    1.22              rect.origin.x < screenRect.origin.x + screenRect.size.width &&
    1.23 @@ -483,7 +485,7 @@
    1.24      SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata;
    1.25      NSRect rect;
    1.26  
    1.27 -    rect = CGDisplayBounds(displaydata->display);
    1.28 +    rect = Cocoa_DisplayBounds(displaydata->display);
    1.29      if ((window->flags & SDL_WINDOW_FULLSCREEN)
    1.30          || window->x == SDL_WINDOWPOS_CENTERED) {
    1.31          rect.origin.x += (rect.size.width - window->w) / 2;