src/video/cocoa/SDL_cocoawindow.m
changeset 5502 ed5f117c949d
parent 5478 6b65ff3cee62
child 5535 96594ac5fd1a
equal deleted inserted replaced
5501:f48c1e0ca9ae 5502:ed5f117c949d
   790     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   790     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   791     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
   791     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
   792     NSWindow *nswindow = data->nswindow;
   792     NSWindow *nswindow = data->nswindow;
   793     NSRect rect;
   793     NSRect rect;
   794 
   794 
       
   795     /* The view responder chain gets messed with during setStyleMask */
       
   796     if ([[nswindow contentView] nextResponder] == data->listener) {
       
   797         [[nswindow contentView] setNextResponder:nil];
       
   798     }
       
   799 
   795     if (fullscreen) {
   800     if (fullscreen) {
   796         SDL_Rect bounds;
   801         SDL_Rect bounds;
   797 
   802 
   798         Cocoa_GetDisplayBounds(_this, display, &bounds);
   803         Cocoa_GetDisplayBounds(_this, display, &bounds);
   799         rect.origin.x = bounds.x;
   804         rect.origin.x = bounds.x;
   823         if ([nswindow respondsToSelector: @selector(setStyleMask:)]) {
   828         if ([nswindow respondsToSelector: @selector(setStyleMask:)]) {
   824             [nswindow performSelector: @selector(setStyleMask:) withObject: (id)(uintptr_t)GetWindowStyle(window)];
   829             [nswindow performSelector: @selector(setStyleMask:) withObject: (id)(uintptr_t)GetWindowStyle(window)];
   825         } else {
   830         } else {
   826             nswindow = Cocoa_RebuildWindow(data, nswindow, GetWindowStyle(window));
   831             nswindow = Cocoa_RebuildWindow(data, nswindow, GetWindowStyle(window));
   827         }
   832         }
       
   833     }
       
   834 
       
   835     /* The view responder chain gets messed with during setStyleMask */
       
   836     if ([[nswindow contentView] nextResponder] != data->listener) {
       
   837         [[nswindow contentView] setNextResponder:data->listener];
   828     }
   838     }
   829 
   839 
   830     s_moveHack = 0;
   840     s_moveHack = 0;
   831     [nswindow setFrameOrigin:rect.origin];
   841     [nswindow setFrameOrigin:rect.origin];
   832     [nswindow setContentSize:rect.size];
   842     [nswindow setContentSize:rect.size];