Android: prevent ignoring surfaceChanged() in MultiWindow
parent
98cc7589b1
commit
5418d41626
|
@ -1739,6 +1739,8 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
|
SDLActivity.nativeSetScreenResolution(width, height, nDeviceWidth, nDeviceHeight, sdlFormat, mDisplay.getRefreshRate());
|
||||||
SDLActivity.onNativeResize();
|
SDLActivity.onNativeResize();
|
||||||
|
|
||||||
|
// Prevent a screen distortion glitch,
|
||||||
|
// for instance when the device is in Landscape and a Portrait App is resumed.
|
||||||
boolean skip = false;
|
boolean skip = false;
|
||||||
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
|
int requestedOrientation = SDLActivity.mSingleton.getRequestedOrientation();
|
||||||
|
|
||||||
|
@ -1768,6 +1770,16 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't skip in MultiWindow.
|
||||||
|
if (skip) {
|
||||||
|
if (Build.VERSION.SDK_INT >= 24) {
|
||||||
|
if (SDLActivity.mSingleton.isInMultiWindowMode()) {
|
||||||
|
Log.v("SDL", "Don't skip in Multi-Window");
|
||||||
|
skip = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (skip) {
|
if (skip) {
|
||||||
Log.v("SDL", "Skip .. Surface is not ready.");
|
Log.v("SDL", "Skip .. Surface is not ready.");
|
||||||
mIsSurfaceReady = false;
|
mIsSurfaceReady = false;
|
||||||
|
|
Loading…
Reference in New Issue