allegro5 icon indicating copy to clipboard operation
allegro5 copied to clipboard

Weirdness with multiple monitors and fullscreen windows on Windows

Open SiegeLord opened this issue 1 year ago • 1 comments

https://github.com/liballeg/allegro5/commit/846c6f5021a6726ed8bd01f423b23e4309cc7037 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.

SiegeLord avatar Jun 17 '24 07:06 SiegeLord

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.

fatcerberus avatar Jun 17 '24 15:06 fatcerberus

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 https://github.com/liballeg/allegro5/issues/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).

SiegeLord avatar Sep 14 '24 19:09 SiegeLord