Today I discovered by experimentation that window_center() needs to be called 10 frames or more after switching from fullscreen to windowed mode. This seems to only be the case if the game starts in fullscreen mode. Documentation just says "at least one frame". 10 frames causes noticeable flicker when toggling modes...
I suspect something else is going on in my code, but I don't see any other delay that could be introduced (everything my code does happens on the first frame of loading the game). Maybe something funny happens only when loading the game, as it toggles to fullscreen mode?
The thing that bothers me about this is I fear I cannot guarantee this 10 frame delay will be the same on other machines. (1) I'd like to know WHY this is happening because it irritates me. (2) I'd like to know how to detect when window_center() actually worked, so I can call it every frame until it does work. (window_get_x/y might work here).