1

I am making a Cocoa application that presents a slide show of videos and images. If there are multiple screens connected (to a Mac Mini for example) I want different content to be shown on each screen. Each NSWindow should be full screen on each NSScreen.

When developing this on OSX 10.8 I set each NSWindow frame to a NSScreen frame with NSBorderlessWindowMask. I did not explicitly use NSApplicationPresentationFullScreen on NSApplication, I used NSApplicationPresentationHideDock and NSApplicationPresentationAutoHideMenuBar.

There seem to be some problems with this approach. Some OSX events seem to force the Menu Bar into view and permanently shift the windows down.

Is there a better approach to this now that OSX Mavericks has updated full screen support? Can I open an NSApplication in true fullscreen mode and force a separate NSWindow to each NSScreen?

Thank you.

Giles
  • 1,428
  • 11
  • 21

1 Answers1

3

You could instantiate one NSWindow per screen and switch them to fullscreen:

[self.windowA setFrame:[[[NSScreen screens] firstObject] visibleFrame] display:NO];
[self.windowB setFrame:[[[NSScreen screens] lastObject] visibleFrame] display:NO];
[self.windowA toggleFullScreen:nil];
[self.windowB toggleFullScreen:nil];
Thomas Zoechling
  • 34,177
  • 3
  • 81
  • 112
  • The code above won't - But it should be very easy to modify it to support >2 windows. – Thomas Zoechling Feb 26 '14 at 13:03
  • Thank you. The first step is what I am currently doing. I was not calling toggleFullScreen on the window though. I will see if that changes the behaviour. – Giles Feb 26 '14 at 16:21