GameViewLayouter
GameViewLayouter copied to clipboard
Using the actual window sizes, not assuming a specific size
Since this is a topic I fiddled with a couple of times in the past, I added our custom code for actually detecting windows and their positions. The "old" version can only cope with identical screens properly ordered from left to right, this version can cope with any screen size combination and arrangement in Windows.
Still not working: if some of the screens are scaled in Windows (e.g. a 4k screen set to 150%).
- added MonitorHelper for actual window positioning (not only identical screens ordered left to right),
- added some logic around whether it exists,
- added "none" option for screens, default option is "none"
Update: now works with scaled and repositioned windows. There were some weird edgecases (e.g. Screen 1 is scaled to 150%, Screen 2 is scaled to 100%, suddenly the window origin is offset differently), but all should be resolved.
Update 2: ordering of screens is still not correct, some more work to do from my side. (just tested on a more complicated setup with a couple of 4k screens at different scales and a FullHD screen at 100% scale)
Update 3: working. Took me way too long, but worked on that now:
Screen 1 has 4k resolution at 125% scale Screen 2 has 4k resolution at 100% scale Screen 3 has FullHD resolution at 100% scale