src/video/cocoa/SDL_cocoawindow.m
changeset 5478 6b65ff3cee62
parent 5466 006883d5fa51
child 5502 ed5f117c949d
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Mar 11 16:03:23 2011 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Mar 11 16:54:43 2011 -0800
     1.3 @@ -670,26 +670,20 @@
     1.4  {
     1.5      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     1.6      NSWindow *nswindow = ((SDL_WindowData *) window->driverdata)->nswindow;
     1.7 -    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
     1.8      NSRect rect;
     1.9 -    SDL_Rect bounds;
    1.10 +    Uint32 moveHack;
    1.11  
    1.12 -    Cocoa_GetDisplayBounds(_this, display, &bounds);
    1.13 -    if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
    1.14 -        rect.origin.x = bounds.x + (bounds.w - window->w) / 2;
    1.15 -    } else {
    1.16 -        rect.origin.x = window->x;
    1.17 -    }
    1.18 -    if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
    1.19 -        rect.origin.y = bounds.y + (bounds.h - window->h) / 2;
    1.20 -    } else {
    1.21 -        rect.origin.y = window->y;
    1.22 -    }
    1.23 +    rect.origin.x = window->x;
    1.24 +    rect.origin.y = window->y;
    1.25      rect.size.width = window->w;
    1.26      rect.size.height = window->h;
    1.27      ConvertNSRect(&rect);
    1.28 -    rect = [nswindow frameRectForContentRect:rect];
    1.29 +
    1.30 +    moveHack = s_moveHack;
    1.31 +    s_moveHack = 0;
    1.32      [nswindow setFrameOrigin:rect.origin];
    1.33 +    s_moveHack = moveHack;
    1.34 +
    1.35      [pool release];
    1.36  }
    1.37