liballeg/allegro5

Weirdness with multiple monitors and fullscreen windows on Windows

Closed this issue · 2 comments

846c6f5 fixed the big issue, but there's flickering and perhaps still an imperfect tracking of which display the window should be on. The issue might be specific to the display creation, and/or the logic in neoSphere.

This is the code that controls fullscreen toggling in neoSphere:
https://github.com/spheredev/neosphere/blob/main/src/neosphere/screen.c#L499-L542

The only Allegro call that happens when enabling fullscreen is:

al_set_display_flag(screen->display, ALLEGRO_FULLSCREEN_WINDOW, screen->fullscreen);

When leaving fullscreen it centers the window on monitor 0 (in the bottom half of that function), but that shouldn't be relevant to the bug here.

I've looked at it again, and indeed there was a problem with neosphere + how it was used. Roughly speaking, the assumption was that monitor 0 was the default monitor, which it is not guaranteed to be. You need to either use a function like this #1578 if you already have a display created, or looking for a monitor with (0, 0) top left corner (which, at least on Windows, identifies the default monitor).