HiDpi Window Positioning on Second Screen

Having a problem setting the position of a window on the second screen while running HiDPI app on windows.
I have a simple test app compiled in Xojo 2017r2.1 and 2017r3 which does

[code]dim w as Window1

dim i as integer
dim s as screen
for i = 0 to ScreenCount - 1
s = screen(i)

w = new window1()
w.Left = s.Left
w.Top = s.Top + 50


next i[/code]

in app open, where Window1 is NOT an implicit instance and no windows set for startup in app.

And in the Window1.Paint event

g.ForeColor = &cff0000 g.FillRect(0,0,g.Width,g.Height) g.ForeColor = &C000000 g.DrawLine(0,0,g.Width,g.Height) g.DrawLine(g.Width,0,0,g.Height)

So basically i am adding a window to top, left of every screen, adding extra 50 pixels down for windows menu bar etc. I would assume that this would work no matter where the screen is position in Windows screen positioning. Alas it only works if it is aligned at top or Bottom. Having the window in the middle somewhere does the following.

However if i turn off HiDPI then

Works as expected after a restart of app.

I am running this on Surface Pro 4, windows 10. Main screen is 200% scaling and external moniter is 1980x1080 at 100% scaling (all the recommended settings)

If i rearrange the displays and apply the changes then the window snaps to the correct location.

Any idea on how to get this to correctly position on HiDPI

Also tested on 2018r1.1 and same problem

Also tested with the 2018r1.1 IDE on windows, surface pro, and the ide opens on the wrong screen (second screen) and is 2 times too large, my scaling is 200 and 100. Something is not quite right with this at the moment.