src/video/cocoa/SDL_cocoawindow.m
changeset 6231 5eecf59b698f
parent 6185 b91e7565e877
child 6301 e8a69c5378e7
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Mon Jan 16 20:40:10 2012 -0500
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Wed Jan 18 22:22:54 2012 -0500
     1.3 @@ -153,8 +153,11 @@
     1.4  - (void)windowDidResize:(NSNotification *)aNotification
     1.5  {
     1.6      SDL_VideoDevice *device = SDL_GetVideoDevice();
     1.7 -    int w, h;
     1.8 +    int x, y, w, h;
     1.9      NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]];
    1.10 +    ConvertNSRect(&rect);
    1.11 +    x = (int)rect.origin.x;
    1.12 +    y = (int)rect.origin.y;
    1.13      w = (int)rect.size.width;
    1.14      h = (int)rect.size.height;
    1.15      if (SDL_IsShapedWindow(_data->window))
    1.16 @@ -164,6 +167,9 @@
    1.17          [((NSOpenGLContext *) device->current_glctx) update];
    1.18      }
    1.19  
    1.20 +    /* The window can move during a resize event, such as when maximizing
    1.21 +       or resizing from a corner */
    1.22 +    SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MOVED, x, y);
    1.23      SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h);
    1.24  }
    1.25