| Summary: | In side-by-side mode (Android ~7+) losing focus will cause SDL_WINDOWEVENT_MINIMIZED + SDL_APP_WILLENTERBACKGROUND | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ellie <etc0de> |
| Component: | events | Assignee: | Sylvain <sylvain.becker> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | icculus, qufighter, sylvain.becker |
| Version: | HG 2.0 | ||
| Hardware: | ARM | ||
| OS: | Android (All) | ||
|
Description
Ellie
2019-04-06 23:59:37 UTC
Indeed, when you split the screen. it goes in the states pause/resume. And we block the loop there. Maybe the app could still run though. ( This might solve bug 4580 as well ? ). and we would really block in stop/restart The only thing is : https://developer.android.com/reference/android/opengl/GLSurfaceView Activity Life-cycle A GLSurfaceView must be notified when to pause and resume rendering. GLSurfaceView clients are required to call onPause() when the activity stops and onResume() when the activity starts. These calls allow GLSurfaceView to pause and resume the rendering thread, and also allow GLSurfaceView to release and recreate the OpenGL display. Rndering seems to stop on pause/resume not stop/restart, but I'll try to see if that work. For what it's worth I got curious and read the docs, and I find them to be quite contradictory so I filed an issue: https://issuetracker.google.com/issues/130114129 So far nobody seems to have cared though, but maybe some day there'll come something of it I just tried source snapshot SDL-2.0.9-12723 on android 7 droid turbo 2
I think this phone is out of date so its tough to say if it represents how split screen works on newer phones, but I did previously work around split screen issues by manually disabling the feature for my app... would love to support split screen and drag-drop features though so the user can select images that way.
Split screen is triggered by holding down the running apps menu button. I would have never found this bugs out my app except by accident.
Previously I had manually disabled split screen on my app, I think to avoid this exact issue (app fails to render once entering spit screen once). This is how I disabled it:
androidMainifest.xml
<activity ...
android:resizeableActivity="false"
android:supportsPictureInPicture="false"
>
Suffice to say I don't see split screen starting to work after this test (which turns out doesn't have all the patches from bug 4580). When I toggle those to be true it seems to revert to the same broken behavior as before.
It does look like the patches use isInMultiWindowMode which makes it seem like the app would use normal pause resume behavior until entering that mode. If thats the case then maybe those will fix this issue too.
I have a nice script now to install a new version for testing so I can try it out pretty easily.
I posted too soon... I had to merge some more things into my androidMainifest.xml and it actually sort of started working in split screen mode and SDL-2.0.9-12723 - still need to test more, doesn't seem broken though. android:alwaysRetainTaskState="true" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|keyboard|keyboardHidden|navigation" Its easy to miss things like this when upgrading! I can't really test the new patches either except to make sure they work on my device. I can confirm split screen which was not working on my device at in 2.0.8 or 2.0.9 is now working reasonably great in SDL-2.0.9-12723. I was able to remove the extra attributes I had added in androidMainifest.xml and split screen continues to work well (as long as I have all the default attributes). I also observe the SDL_WINDOWEVENT_FOCUS_LOST and SDL_WINDOWEVENT_FOCUS_GAINED events. I didn't get around to test it for a while but recently I did and completely forgot to comment, I can confirm that with hg tip it works nicely for me as well! (I tested on Android 8.1) The app continues redrawing and responds nicely to hardware mouse wheels while out of focus in side by side, it works perfectly as far as I can tell This appears to be fixed; please reopen if I'm wrong! --ryan. |