Make sure we're rendering whenever the activity might be visible, even if we don't have focus.

This fixes rendering when a system dialog is over the application
main
Sam Lantinga 2023-12-18 19:21:00 -08:00
parent 69ec0322d3
commit 9d13be743b
2 changed files with 3 additions and 23 deletions

View File

@ -788,7 +788,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
// Try a transition to resumed state // Try a transition to resumed state
if (mNextNativeState == NativeState.RESUMED) { if (mNextNativeState == NativeState.RESUMED) {
if (mSurface.mIsSurfaceReady && mHasFocus && mIsResumedCalled) { if (mSurface.mIsSurfaceReady && (mHasFocus || mHasMultiWindow) && mIsResumedCalled) {
if (mSDLThread == null) { if (mSDLThread == null) {
// This is the entry point to the C app. // This is the entry point to the C app.
// Start up the C app thread and enable sensor input for the first time // Start up the C app thread and enable sensor input for the first time
@ -1133,23 +1133,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
* This method is called by SDL using JNI. * This method is called by SDL using JNI.
*/ */
public static boolean shouldMinimizeOnFocusLoss() { public static boolean shouldMinimizeOnFocusLoss() {
/*
if (Build.VERSION.SDK_INT >= 24) {
if (mSingleton == null) {
return true;
}
if (mSingleton.isInMultiWindowMode()) {
return false;
}
if (mSingleton.isInPictureInPictureMode()) {
return false;
}
}
return true;
*/
return false; return false;
} }

View File

@ -164,13 +164,10 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
} }
} }
// Don't skip in MultiWindow. // Don't skip if we might be multi-window or have popup dialogs
if (skip) { if (skip) {
if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) { if (Build.VERSION.SDK_INT >= 24 /* Android 7.0 (N) */) {
if (SDLActivity.mSingleton.isInMultiWindowMode()) { skip = false;
Log.v("SDL", "Don't skip in Multi-Window");
skip = false;
}
} }
} }