title: NSView containing NSOpenGLView doesn't redraw after a subview is removed
body: <p>I have a Mac OS X (10.9) application with a custom NSView for my main NSWindow's <code>contentView</code> property. The only thing the custom view does is override <code>drawRect:</code> so that it's transparent. Transparency is required so that my NSOpenGLView is visible (see below):</p>
  
  <pre><code>/* Transparent NSView Subclass */
  - (void)drawRect:(NSRect)dirtyRect
  {
    NSLog(@"Drawing Rect");
    [[NSColor clearColor] set];
    NSRectFillUsingOperation(dirtyRect, NSCompositeClear);
  }
  </code></pre>
  
  <p>The <code>contentView</code> has an NSOpenGLView as a subview, with its surface order set to -1 (it's 'below' the main NSWindow, which is also transparent):</p>
  
  <pre><code>/* NSOpenGLView subclass: */
  GLint order = -1;
  [self.openGLContext setValues:&amp;order forParameter:NSOpenGLCPSurfaceOrder];
  </code></pre>
  
  <p>I then instantiate a WebView and place it as a subview of this custom view:</p>
  
  <pre><code>_webview = [[WebView alloc] initWithFrame:frame];
  [_webview setMaintainsBackForwardList:NO];
  [_webview setTranslatesAutoresizingMaskIntoConstraints:NO];
  [_webview setDrawsBackground:NO];
  [_window.contentView addSubview:_webview];
  </code></pre>
  
  <p>The WebView is a small box in the window (on top of the NSOpenGLView) which is used to login to a service. Once login happens it should disappear, showing only the NSOpenGLView. </p>
  
  <p>Here's the problem: when I call <code>[_webview removeFromSuperview];</code> the <code>contentView</code> does not redraw; therefore, the WebView is still drawn on the screen (although not responsive to mouse or keyboard). If I use my mouse to resize the window that everything is in, the <code>contentView</code> redraws (I see the message in the logs) and the WebView's content disappears. 
  Also, if I don't add the NSOpenGLView as a subview, the WebView goes away as it should.</p>
  
  <p>Shouldn't the <code>contentView</code> fire a <code>drawRect</code> after a subview is removed? Even when I used <code>setNeedsDisplay:</code> or <code>setNeedsLayout:</code> after removing the WebView the <code>contentView</code> still didn't redraw.</p>