title: NSWindow spanning multiple screens in Mavericks
body: <p>I have a full screen application that opens an NSWindow that will cover all available displays.</p>
  
  <pre><code>NSRect screenArea = {{0,0},{0,0}};
  for(int i=0; i&lt;[[NSScreen screens] count]; i++) {
      screenArea = NSUnionRect(screenArea, [[[NSScreen screens] objectAtIndex:i] frame]);
  }
  
  self.fullScreenView = [[MDScreenShotImageView alloc] initWithFrame:screenArea];
  [self.fullScreenView setDelegate:self];
  
  self.fullScreenWindow = [[MDWindow alloc] initWithContentRect:screenArea styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
  [self.fullScreenWindow setDelegate:self];
  [self.fullScreenWindow setReleasedWhenClosed:NO];
  [self.fullScreenWindow setMovableByWindowBackground:NO];
  [self.fullScreenWindow setBackgroundColor:[NSColor whiteColor]];
  [self.fullScreenWindow setLevel:NSScreenSaverWindowLevel];
  [self.fullScreenWindow setOpaque:YES];
  [self.fullScreenWindow setHasShadow:NO];
  [self.fullScreenWindow setBackgroundColor:[NSColor blackColor]];
  [self.fullScreenWindow setContentView:self.fullScreenView];
  </code></pre>
  
  <p>In Mountain Lion this worked great! I had a full screen window covering both my displays (which are set side by side in the Displays System Preference pane). In Mavericks this does not work any more. OSX will automatically cut my NSWindow so that only the part on the largest screen will be visible. The part on the other screen is cut off and nothing is visible on this screen. I have drawer crossing lines on the NSWindow to illustrate below:
  <img src="https://i.stack.imgur.com/HCpAK.jpg" alt="enter image description here"></p>
  
  <p>I know that this is a thing that changed in Mavericks. I can get back the old behavior by going into System Preferences, Mission Control and unpicking "Displays Have separate Spaces".
  <img src="https://i.stack.imgur.com/HEZug.png" alt="enter image description here"></p>
  
  <p>But I don't want to force my users to do this since it would cause a very bad user experience. I really need a full screen window spanning all displays, but I don't want to force the users to enable the option. Is there a workaround for this?
  <img src="https://i.stack.imgur.com/KTcxK.jpg" alt="enter image description here"></p>
  
  <p><strong>UPDATE 1: Thanks Will Shipley for the suggestion to have two windows. I have tried this as following:</strong></p>
  
  <pre><code>NSRect rect1 = [[[NSScreen screens] objectAtIndex:0] frame];
  NSRect rect2 = [[[NSScreen screens] objectAtIndex:1] frame];
  
  MDScreenShotImageView *screenShotImageView = [[MDScreenShotImageView alloc] initWithFrame:rect1];
  self.fullScreenView = screenShotImageView;
  [self.fullScreenView setDelegate:self];
  
  MDWindow *window = [[MDWindow alloc] initWithContentRect:rect1 styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
  self.fullScreenWindow = window;
  
  [self.fullScreenWindow setDelegate:self];
  [self.fullScreenWindow setReleasedWhenClosed:NO];
  [self.fullScreenWindow setMovableByWindowBackground:NO];
  [self.fullScreenWindow setBackgroundColor:[NSColor whiteColor]];
  [self.fullScreenWindow setLevel:NSScreenSaverWindowLevel];
  [self.fullScreenWindow setOpaque:YES];
  [self.fullScreenWindow setHasShadow:NO];
  [self.fullScreenWindow setBackgroundColor:[NSColor blackColor]];
  [self.fullScreenWindow setContentView:self.fullScreenView];
  
  
  MDScreenShotImageView *screenShotImageView2 = [[MDScreenShotImageView alloc] initWithFrame:rect2];
  self.fullScreenView2 = screenShotImageView2;
  [self.fullScreenView2 setDelegate:self];
  
  MDWindow *window2 = [[MDWindow alloc] initWithContentRect:rect2 styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
  self.fullScreenWindow2 = window2;
  
  [self.fullScreenWindow2 setDelegate:self];
  [self.fullScreenWindow2 setReleasedWhenClosed:NO];
  [self.fullScreenWindow2 setMovableByWindowBackground:NO];
  [self.fullScreenWindow2 setBackgroundColor:[NSColor whiteColor]];
  [self.fullScreenWindow2 setLevel:NSScreenSaverWindowLevel];
  [self.fullScreenWindow2 setOpaque:YES];
  [self.fullScreenWindow2 setHasShadow:NO];
  [self.fullScreenWindow2 setBackgroundColor:[NSColor blackColor]];
  [self.fullScreenWindow2 setContentView:self.fullScreenView2];
  
  [self.fullScreenWindow display];
  [self.fullScreenWindow2 display];
  </code></pre>
  
  <p>Unfortunately I cannot get this to work, maybe I am doing something incorrectly but the window is only displayed on one screen.</p>