Hello,
My computer has 2 screens. The Dock sits in the second screen.
Using the Xojo’s Screen object, I get these values:
Screen 1: {0,0,1920,1080} (available values: {0,23,1920,1057})
Screen 2: {-1280,0,1280,1024} (available values: {-1280,23,1280,958})
Now, with NSScreenMBS, the result is different:
Screen 1: {0,0,1920,1080} (visible frame: {0,0,1920,1057})
Screen 2: {-1280,56,1280,1024} (visible frame: {-1280,101,1280,956})
The problem lies about the top values.
1: The Screen object reports 23 for the AvailableTop value of screen 1 and 0 for the whole frame, while the NSScreen version returns 0 for both top values.
2: For screen 2, the Screen object returns 0 and 23 while the NSScreen object returns 56 and 101.
Both objects don’t compute the top the same way; I guess vertically-organised screens would have the problem for the left properties.
My problem is, in Xojo, placing a window requires the values of the Screen class, but I must deal with a NSScreen (the Screen class can’t figure out the main screen, the one the user is focused at; NSScreen can, using NSScreenMBS.MainScreen).
I can’t find a reliable way to get the Xojo’s screen corresponding to a NSScreenMBS object (I could rely on the width and height of both classes, in my case, but if both screens have the same resolution, it won’t work). Unless both are guaranteed to always be indexed the same, but I couldn’t find that information.
Wondering what these differences are about and how I can solve my problem