Skip to content

Improving Multi-Monitor Support on Windows

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:
https://tracker.xojo.com/xojoinc/xojo/-/issues/54369
https://tracker.xojo.com/xojoinc/xojo/-/issues/69125

William Yu grew up in Canada learning to program BASIC on a Vic-20. He is Xojo’s resident Windows and Linux engineer, among his many other skills. Some may say he has joined the dark side here in the USA, but he will always be a Canadian at heart.