The Bug Bash was good at bringing back to our attention some older bugs. One such issue was multi-monitor support with mixed scale factors on Windows. While supporting 2 monitors at different scale factors worked for the most part, anything beyond that was flawed.
Why is this even a problem?
In Xojo our coordinates (Left, Top, Width, Height, etc.) are in points. On Linux and macOS the underlying system APIs that we use also treat coordinates as points. However, on Windows we are still left using APIs that deal with pixels. This meant writing our own Pixel to Point (and vice versa) conversion functions for moving/sizing, along with a system to mimic how Windows finds the best monitor for a Window based on it’s size/location, but in points.
A Warped Brain
To be honest, thinking about more than just 2 monitors with mixed scaling became a serious spatial issue. I had to draw this to envision what needed to be done.
Last, but not least, we needed to test this. So after a quick run to the store, I picked up this little adapter and voila, a fix was born!
To read more about the issues addressed here, see:
William Yu grew up in Canada learning to program BASIC on a Vic-20. Many years later he started building his own BASIC variant called Rapid-Q which was acquired then by Xojo. He now lives happily with his wife and 3 adorable kids in Texas. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.