lexikos wrote: ↑28 Jun 2020, 22:33
Are you saying that if you select "3" in Display Settings, the option "Make this my main display" is NOT ticked?
correct.
when I select monitor 1, the option "Make this my main display" is ticked.
I decided to test this by selecting each other monitor (monitor 2 and 3) and ticking the option "Make this my main display".
When I made Monitor 2 my Main Display and ran the code in the OP, Primary Monitor returned as #2 as expected, however when I made Monitor 3 my Main Display and ran the code in OP, Primary Monitor returned as #1 instead of my selection of Monitor 3.
Result when I selected Monitor 3 as Main Display: