Spotting the Primary Desktop
When multiple desktops are open, it is important to know that only the primary desktop will have a menu bar. Additionally, the title bar on the client will show the name of the project. Additional Desktops will instead show the handle or index of the Desktop by default. However, a custom title may be used when the desktop is invoked.
Below we see two desktops. The highlighted desktop is displaying the title of the project. Because this is the primary desktop, a menu bar is present. The other desktop was given a title of "Secondary Desktop". A menu bar is not present because this desktop is not the primary.
When a project update is pushed to a Client, the Update banner will only appear on the Primary Desktop (assuming the Update Mode of the project is set to Notify). Updating the Primary Desktop will also push the changes to all other local desktop, so there is no need to update each desktop individually.
Opening Another Desktop
Another Desktop may be opened by calling system.gui.openDesktop:
However, without specifying which windows to open, the desktop will open without any opened windows. It is recommended to specify at least one window, a title, and a handle for the new desktop. Assuming a window exists at the path "Main Windows/Main Window", the following would open a new desktop, open the specified window, and specify a title and handle for the window.
Navigating Windows in Desktops
Functions for the gui and nav scripting modules will execute in the Desktop that originated the call: If the Primary Desktop calls system.nav.swapTo, then the Primary Desktop will swap to a new window, but all other desktops will remain unaffected. However, it is possible for a script on one Desktop to force a navigation or GUI change on another Desktop with the following functions:
Additional scripting functions that interact with desktops exist in the gui and nav scripting modules. Please see the System Functions in the Appendix for more details.
Opening a Desktop on Each Monitor
Sometimes you may want your client to open a new desktop on each of your other monitors. It's pretty simple to get all of your monitors and open a client on each, but then you will have two on your main monitor. The following code block shows you how to skip the primary monitor and even how to open specific windows on each new desktop. This example assumes you have a 'Main Window/Overview' window, and that window has a custom string property in the root container named 'Display' to pass values into. Bind a label component to that custom property to easily check your script. This script is best placed in a Client Startup Script to open a client for each monitor on startup.