Gieta Laksmana
  • Blog
  • Profile
  • Projects
    • VR World Arcade
    • Punch For Fun
    • Spectrum
    • Dimension Battle
  • Resume

MacOS Multi Monitor Shenanigans

10/25/2016

0 Comments

 
let's say you want your Mac app to have multiple windows, pretty reasonable request right? Now, lets say you have 2 monitor setup on your Mac, and you like to have each window on its own screen. Move one window to the first screen, and move the other window to the second screen, got it. Now what if you want both to be full screened on each screen?

if you have this setting under System Preferences > Mission Control enabled,
then you wont hit this problem. But if you're like me and have it disabled, you might be wondering why your secondary monitor stays black. keep on reading...
Picture
Displays? Spaces?

One of the key feature in MacOS is Spaces. It's that thing that you see at the top when you go to Mission Control (usually by pressing F3 in most Mac keyboard) that helps you organize and declutter apps windows.

The deal with the setting I mentioned in the beginning has to do with what happen when you attach a second, or third, or 'n'th monitor to your Mac. If you have the setting enabled, it will create a Space for each monitor. But if you disable it, all monitors will share the same space.

This isn't really an issue until you want your app to be fullscreened. When a window is changed to full screen, MacOS will create a new exclusive space for it and move the window there.

So when you make 1 of your window a fullscreen window, a new exclusive space will be created, and only your window will be placed there. To add your other windows to this fullscreen space, you need to do this to your window:
window.collectionBehavior.remove(.fullScreenPrimary)
window.collectionBehavior.insert(.fullScreenAuxiliary)
0 Comments



Leave a Reply.

    Archives

    September 2018
    August 2018
    July 2018
    September 2017
    July 2017
    November 2016
    October 2016
    September 2016
    June 2016
    May 2016
    March 2016

    Categories

    All
    Shenanigans
    Software Engineering
    Swift
    Vr
    Xcode

    RSS Feed

Powered by Create your own unique website with customizable templates.