MultiScreen positioning with Separate Spaces for screens?

I want to be able to position windows on different screens (I have 3)… Does Xojo have a built in way of handling that when “Displays have Separate Spaces” is turned on?

The code below displays all 3 windows on the main screen… Which makes sense sort of… but I can manually drag windows between the different screens

If there is a way to address each space to place a Window on a specific screen in this case, I would also need a way to find out which “space” an existing window is in…

This is API 1 code but looking at the docs I don’t see anything different for API 2 :

Dim W as Window1

For i as Integer = ScreenCount -1 DownTo 0
  W = New Window1
  W.Title = "Screen " + str(i)
  W.Left = Screen(i).Left
next

Thanks,
-Karen

API2 equivalent of your code is this, not sure about spaces though:

For iDisplay As Integer = 0 To DesktopDisplay.LastDisplayIndex

  W = New Window1
  W.Title = "Screen " + str( iDisplay )
  W.Left = DesktopDisplay.DisplayAt( iDisplay ).Left
  
Next

API 2 code would not make a difference…

I believe Xojo’s API assumes that the X values are continuous across all screens, which is not the case when the user has activated the MacOS “Spaces” feature.

I don’t know if there is a way (outside of perhaps declares) of placing a window on a specific screen or detecting which screen a window is on when the spaces feature is active.

  • Karen

I didn’t really expect it would. Both APIs deal with real display devices whereas Spaces are a virtual layer on top of those. I suspect your only hope is declares. Stage Manager will likely throw another layer into the mix.