title: Full Screen Cocoa Application - Force Quit
body: <p>I am facing a weird issue when trying to make a full screen application. I am currently using a a <code>NSWindow</code> with a <code>NSBorderlessWindowMask</code> to make the screen show at top, and I subclassed <code>NSWindow</code> to accept keys:</p>
  
  <pre><code>- (BOOL) canBecomeKeyWindow
  {
      return YES;
  }
  </code></pre>
  
  <p>This works fine, and I can use keys in my window, and quit out of the application with Command + Q. However, when I try to force quit the application on my Mac, the screen freezes, and I must restart my computer. I have a simple WebView inside my Window:</p>
  
  <pre><code>mainWindow = [[MyBorderWindow alloc] initWithContentRect:screenRect
                                           styleMask:NSBorderlessWindowMask
                                             backing:NSBackingStoreBuffered
                                               defer:NO screen:[NSScreen mainScreen]];
  
  
  [mainWindow setLevel:windowLevel];
  [mainWindow setBackgroundColor:[NSColor blackColor]];
  [mainWindow makeKeyAndOrderFront:nil];
  NSView *contentView = [mainWindow contentView];
  WebView *customView = [[WebView alloc] initWithFrame:[contentView bounds]];
  [customView setTranslatesAutoresizingMaskIntoConstraints:NO];
  [contentView addSubview:customView];
  </code></pre>
  
  <p>I have tried the application on another computer, and force quit does not freeze the screen. Both computers are running OS X Mavericks. </p>
  
  <p>Please let me know if there is anything else I should add.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Bucco</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I think that my applicationWillTerminate method in AppDelegate might be part of the issue, but am not sure. Why would this method work fine on another computer, but not mine?</p>
  
  <pre><code>- (void)applicationWillTerminate:(NSNotification *)notification
  {
      [mainWindow orderOut:self];
  
      // Release the display(s)
      if (CGDisplayRelease( kCGDirectMainDisplay ) != kCGErrorSuccess) {
          NSLog( @"Couldn't release the display(s)!" );
      }
  }
  </code></pre>