I have started moving a c++ Firemonkey project from Rad Studio 10.3 to the latest 12.1
However, Screen->Displays doesn’t return the correct screen size and location anymore and code which runs fine under 10.3 doesn’t work under 12.1.
My laptop has two external monitors, making 3 screens total.
Using display settings I can see that screen 1 is 3840 x 2400, Screen 2 and 3 are 1920 x 1080. My screens are ordered 3, 2, 1. With Left for Screen 3 being 0, Left for Screen 2 is 1920 and Left for Screen 3 is 3840. I am using the screen positions to place a form to fill the entire screen, so having correct size and location is very important.
When I run this code under 12.1
Screen->UpdateDisplayInformation();
for (int i = 0; i < Screen->DisplayCount; i++)
{
MainForm->LogMsg("Screen : " + IntToStr(i + 1) + "," +
IntToStr((int)Screen->Displays[i].Bounds.Width()) + "," +
IntToStr((int)Screen->Displays[i].Bounds.Height()));
}
I get
Screen : 1,1536,960
Screen : 2,1920,1080
Screen : 3,1920,1080
If I get the workarea instead I get
Screen : 1,1536,960
Screen : 2,1920,1032
Screen : 3,1920,1080
Screens 2 and 3 are correct, but screen 1 is incorrect, as is the screen location.
If I try to position a form to fill screen 1, it appears instead in the screen 3 location.
If I switch back to build under 10.3, all works fine, sizes and positions are correct.
Hopefully someone can tell me why this no longer works.