for years i’d thought that [NSScreen mainScreen] returns the screen with menu. It returns the screen with the window that has keyboard focus
My testing doesn’t agree with +mainScreen’s documentation:
The main screen is not necessarily the same screen that contains the menu bar or has its origin at (0, 0). The main screen refers to the screen containing the window that is currently receiving keyboard events. It is the main screen because it is the one with which the user is most likely interacting.
In my testing, +mainScreen is constant and doesn’t change depending on which window on which screen is receiving keyboard events.
But I’ll follow its advice anyway:
The screen containing the menu bar is always the first object (index 0) in the array returned by the
screensmethod.