"change" fires whenever the display configuration changes — monitors connected/disconnected, resolution or arrangement changes, or the menu bar moving to a different display. The listener gets no arguments; call all()/main()/primary() inside it to inspect the new configuration.
"spaceChange" fires whenever a screen switches to a different space. If several screens switch at once, it fires once for each. The listener gets an object with the screen that switched (null if it has just been disconnected), the space it was showing before (from, null for a screen that has just been connected), and the space it's showing now (to).
Register a listener for screen events.
"change"fires whenever the display configuration changes — monitors connected/disconnected, resolution or arrangement changes, or the menu bar moving to a different display. The listener gets no arguments; call all()/main()/primary() inside it to inspect the new configuration."spaceChange"fires whenever a screen switches to a different space. If several screens switch at once, it fires once for each. The listener gets an object with thescreenthat switched (nullif it has just been disconnected), the space it was showing before (from,nullfor a screen that has just been connected), and the space it's showing now (to).