[Solved] Search for workaround/fix for broken windowed mode on Android [FIXED in hg]

With a bump to API level 27 and SDL 2.0.9, I ran into an issue with windowed mode on Android: when my SDL app launches and SDL_CreateWindow() doesn’t specify any fullscreen flags, it will use that weird kind-of-fullscreen-but-not mode, with the topbar & button bar half-transparent sliding away after a second or so, and the topbar staying half-there kinda overlayed. This is not only distracting, but actually obstructs the apps own topbar and makes it borderline unusable…

Ticket is here: https://bugzilla.libsdl.org/show_bug.cgi?id=4424

I’m relatively sure this is an SDL bug because when I use SDL_SetWindowFullscreen() to switch to fullscreen, I get proper fullscreen with all bars permanently gone, and if I use it again to go back to windowed, I get proper windowed with the bars fully there & solid, no weird sliding.

However, that fullscreen-and-back workaround hack only works with a delay, so I’d need delayed timer ugliness or something. Therefore, I’ve wondered if anyone has an idea for a better workaround that doesn’t involve unreliable timing magic?

Edit: okay, here an illustration of the problem:

When I start an android app with no fullscreen flags, I expect to get Variant 1 (left). This is also what I used to get with an old SDL2 at API level 19.

However, with SDL 2.0.9 + API 27 I get Variant 3 (right) for my windowed application with bars overlaying content, obstructing vital UI buttons and being generally annoying by shifting in/out of view.

As soon as I enable fullscreen on SDL 2.0.9 I revert to Variant 2, and when I go to windowed again I get Variant 1, but only after those two switches, and only if I do them with some delay (can’t just do it instantly after window creation with no pause) - and that kinda sucks. So, any suggestions what to do about that?

To discard this behaviour, you can comment out in SDLActivity.java the line:
mSingleton.sendCommand(COMMAND_CHANGE_WINDOW_STYLE, fullscreen ? 1 : 0);