sdl2_frt/android-project
Sam Lantinga 9950271bb6 Fixed bug 4580 - Android 8: immersive fullscreen notification causes flickering between fullscreen and non-fullscreen and app is unresponsive
Sylvain 2019-04-18 21:22:59 UTC

Changes:
- SDL_WINDOWEVENT_FOCUS_GAINED and SDL_WINDOWEVENT_FOCUS_LOST are sent when the java method onWindowFocusChanged() is called.

- If we have support for MultiWindow (eg API >= 24), SDL event loop is blocked/un-blocked (or simply egl-backed-up or not), when java onStart()/onStop() are called.

- If not, this behaves like now, SDL event loop is blocked/un-blocked when onPause()/onResume() are called.

So if we have two app on screen and switch from one to the other, only FOCUS events are sent (and onPause()/onResume() are called but empty. onStart()/onStop() are not called).
The SDL app, un-focused, would still continue to run and display frames (currently the App would be displayed, but paused).
Like a video player app or a chronometer that would still be refreshed, even if the window hasn't the focus.
It should work also on ChromeBooks (not tested), with two apps opened at the same time.


I am not sure this fix Dan's issue. Because focus lost event triggers Minimize function (which BTW is not provided on android).
https://hg.libsdl.org/SDL/file/bb41b3635c34/src/video/SDL_video.c#l2653
https://hg.libsdl.org/SDL/file/bb41b3635c34/src/video/SDL_video.c#l2634

So, in addition, it would need to add by default SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS to 0.
So that the lost focus event doesn't try to minimize the window. And this should fix also the issue.
2019-04-22 16:19:52 -07:00
..
app Fixed bug 4580 - Android 8: immersive fullscreen notification causes flickering between fullscreen and non-fullscreen and app is unresponsive 2019-04-22 16:19:52 -07:00
gradle/wrapper Updated Android project files and documentation 2018-10-28 10:31:06 -07:00
build.gradle Updated Android project files and documentation 2018-10-28 10:31:06 -07:00
gradle.properties Switched to new style gradle Android application build process 2017-10-23 15:23:43 -07:00
gradlew Switched to new style gradle Android application build process 2017-10-23 15:23:43 -07:00
gradlew.bat Switched to new style gradle Android application build process 2017-10-23 15:23:43 -07:00
settings.gradle Switched to new style gradle Android application build process 2017-10-23 15:23:43 -07:00