Opening Modal Windows on Second Screen

Menu bars are on every screen by default (is there an option to not have the menu bar on every screen?). However, the active screen has a menu bar less transparent than on the other screens. This active screen (the one where a window is frontmost and has the focus) can be accessed by NSScreenMBS.mainScreen, for instance.

On the other hand, the dock is only on a single screen (along with the application switcher); you can make it appear on a different screen by moving your mouse at the bottom of that different screen.

And there’s the screen where a window would open by default if you don’t tell it otherwise. That’s the same screen you put the menu bar icon in System Preferences→Displays.

Don’t tell me it’s confusing :thinking: :wink:

This is not always true. For example, GIMP always opens a dialog to convert the colorscale on the other Monitor…
The quit dialog always ope, on the same “other” monitor…

El Capitan AND High Sierra…

Notice I said:

According to Reddit:

If you enable „Displays have separate spaces“ in the System Preferences, you’ll have the menu bar on both displays, without an additional app.

I remember having to fix a fun bug: “MAX no longer snaps back to first monitor when the second monitor doesn’t have a menubar.”

What I wanted to achieve was:

  • to open Modal Window on the same screen as “father” window
  • to open above mentioned Modal Window at center of “father” window

I noticed Window(0) is still valid for “father” window until the Open event of new right-now-being-opened Modal Window is finished its execution.

Position of menu bar is irrelevant.

I allowed myself to alter your source - now Window3 opens as it should.
ModalOpeningOnSecondScreen 2.xojo_binary_project

The main benefit for me was that I didn’t have to alter multiple places in source to “moderate” the way new Modal Window is about to open - using Open event in Modal Window itself takes care of the process on it’s own.

1 Like

I cannot anymore place a window one part on a monitor, the other part on the other monitor. Once it is the case, only one monitor disply the visible part of the window (the other is hidded).

The trick given above missed “You have to reboot” before it works…

Now, I can share a window between two Monitors… !

1 Like

This behaviour has existed for a long time (I think it came along with when menu bars started to be shown on all screens; 10.11 or earlier?)

Managing windows with some remote screen sharing software can be a nightmare with this behaviour: you can’t move one window from one screen to another even if you let the window across the 2 screens (since it’s visible only on one screen at once), unless you use a tool which shows two screens at a time (only Apple Remote Desktop seems to allow that).

This was the hint that let me find where to invert the feature back to what it was.

1 Like