SDL: more attempts to draw in the display cutout

This commit is contained in:
Sergii Pylypenko
2021-05-21 03:42:55 +03:00
parent c5d8e8b3c7
commit 21adbe6a1e
7 changed files with 31 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ import android.net.Uri;
import android.Manifest;
import android.content.pm.PackageManager;
import android.hardware.input.InputManager;
import android.graphics.Rect;
class Mouse
@@ -702,6 +703,14 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer
hh = topView.getHeight() - topView.getHeight() % 2;
}
if (Globals.DrawInDisplayCutout) {
final Rect r = new Rect();
context._videoLayout.getWindowVisibleDisplayFrame(r);
//ww = r.width();
//hh = r.height();
//Log.v("SDL", "DemoRenderer.onWindowResize(): adjusted to display cutout");
}
Display display = context.getWindowManager().getDefaultDisplay();
if (mWidth != 0 && mHeight != 0 && (mWidth != ww || mHeight != hh))