Hi, today I debugged into an issue and here's what I found.
Windows 10, Intel graphics.
The laptop has three displays which are enumerated in wsystem.c, and unfortunately only one has the flag DISPLAY_DEVICE_ATTACHED_TO_DESKTOP set. So the reported number of display drivers is 1, but the adapter 0 is not connected to the desktop, which results in win_get_monitor_info reporting a size of 0,0.
So there is an implicit assumption: all enumerated displays which are connected to the desktop are listed first.
I'm not sure about the linux part, but on windows well it's not always true.
As a side note, this happens when I set the laptop to sleep and take put it back into the docking station which is connected to a 4k monitor...
The solution is to use the same logic within win_get_monitor_info as is used in win_get_num_video_adapters to find the nth display that is connected to a desktop.
Here's the updated code (on recent (liballeg/master) wsystem.c line 484ff:
I'll try to format a patch as well.
Edit: patch file attached.
Thanks a lot! I tried to reproduce this issue, but I couldn't so thanks a lot for your work and fix. The logic seems to make sense and it doesn't seem to break things for me.
Thanks for submitting!