title: Displaying two fullscreen windows on two monitors in Adobe AIR on Mac OS X (Mavericks)
body: <p>I'm on Mac OS X (Mavericks). Using Adobe AIR, I want to display separate fullscreen windows on each of my two monitors (builtin laptop retina display and external hdmi monitor).</p>
  
  <p>I'm able to get a fullscreen window on my main monitor and an almost fullscreen window on the secondary one. When I say 'almost', I mean that the window is fullscreen except for the space at the top where the menu bar would be (the desktop's background image is showing): </p>
  
  <p><img src="https://i.stack.imgur.com/912tu.png" alt="Second monitor"></p>
  
  <p>At first I thought it was a problem with AIR but I'm starting to think it may be an OS X limitation. If I interact with the primary screen, everything is normal. However, if I click on the secondary screen, the menu bars on both screens appear. It is as though only the first screen is really in "fullscreen mode". It seems the second one is treated as a maximized chromeless window.</p>
  
  <p>Do you guys know what's going on ? Here is the code I'm using:</p>
  
  <pre><code>package {
  
      import flash.display.NativeWindow;
      import flash.display.NativeWindowInitOptions;
      import flash.display.NativeWindowSystemChrome;
      import flash.display.Screen;
      import flash.display.Sprite;
      import flash.display.StageAlign;
      import flash.display.StageDisplayState;
      import flash.display.StageScaleMode;
      import flash.text.TextField;
      import flash.text.TextFormat;
      import flash.text.TextFormatAlign;
  
      public class TwoFullscreenNativeWindowsInTwoMonitors extends Sprite {
  
          public var secondWindow:NativeWindow;
  
          public function TwoFullscreenNativeWindowsInTwoMonitors() {
  
              // Make primary (default) window's stage go fullscreen
              stage.align = StageAlign.TOP_LEFT;
              stage.scaleMode = StageScaleMode.NO_SCALE;
              stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
              stage.color = 0xC02A2A; // red
  
              // Create fullscreen window on second monitor (check if available first)
              if (Screen.screens[1]) {
  
                  // Window
                  var nwio:NativeWindowInitOptions = new NativeWindowInitOptions();
                  nwio.systemChrome = NativeWindowSystemChrome.NONE;
                  secondWindow = new NativeWindow(nwio);
                  secondWindow.bounds = (Screen.screens[1] as Screen).bounds;
                  secondWindow.activate();
  
                  // Stage
                  secondWindow.stage.align = StageAlign.TOP_LEFT;
                  secondWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
                  secondWindow.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
                  secondWindow.stage.color = 0x387D19; // green
  
              }
  
          }
  
      }
  
  }
  </code></pre>
  
  <p><strong>UPDATE 1</strong>:</p>
  
  <p>I managed to fill the menu bar space by using an ugly hack... That is, by waiting a second and then re-setting the window height. However, the second window is still not acting "fullscreen". If I click on it, the menu bar appears...</p>
  
  <p>One can achieve a similar result by ticking off the “Displays have separate Spaces” checkbox in OS X Mission Control preference pane</p>
  
  <p><strong>UPDATE 2</strong>:</p>
  
  <p>It seems this is a <a href="https://bugbase.adobe.com/index.cfm?event=bug&amp;id=2949452" rel="nofollow noreferrer">long standing bug</a> known by Adobe since 2011... </p>