src/video/cocoa/SDL_cocoawindow.m
changeset 6185 b91e7565e877
parent 6138 4c64952a58fb
child 6231 5eecf59b698f
equal deleted inserted replaced
6184:976d9ec6c290 6185:b91e7565e877
   524     data->listener = [[Cocoa_WindowListener alloc] init];
   524     data->listener = [[Cocoa_WindowListener alloc] init];
   525 
   525 
   526     /* Fill in the SDL window with the window data */
   526     /* Fill in the SDL window with the window data */
   527     {
   527     {
   528         NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
   528         NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]];
   529         NSView *contentView = [[SDLView alloc] initWithFrame:rect];
   529         NSView *contentView = [ nswindow contentView ];
   530         [nswindow setContentView: contentView];
   530         /* Create view if not already exists */
   531         [contentView release];
   531         if (!contentView) {
       
   532             contentView = [[SDLView alloc] initWithFrame:rect];
       
   533             [nswindow setContentView: contentView];
       
   534             [contentView release];
       
   535         }
   532 
   536 
   533         ConvertNSRect(&rect);
   537         ConvertNSRect(&rect);
   534         window->x = (int)rect.origin.x;
   538         window->x = (int)rect.origin.x;
   535         window->y = (int)rect.origin.y;
   539         window->y = (int)rect.origin.y;
   536         window->w = (int)rect.size.width;
   540         window->w = (int)rect.size.width;