Godot notch/borderless fullscreen problems with android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Xioor

Hello, from the image you can see that a black border appears at the top. I tried to set full screen in godot. I also tried a lot of different variations android:style in the
manifest on the activity and on the application but no luck. If I go in the android’s phone settings and go in the full screen apps settings, I can set my game to force full screen, and then I don’t
see the black border anymore. But other apps are set on auto and they don’t have the black border.

Image here: Godot-Notch hosted at ImgBB — ImgBB

Also it looks like OS.get_window_safe_area() does not report the correct safe area when you have a notch in android. It works with iPhone X tho.

I’m using godot 3.2.2
Some of my godot settings:
width 1080
height 1920
resizable = true
borderless = true
full screen = true
portrait
Stretch:
mode 2d
aspect expand
shrink 1

I tried this using a samsung galaxy s20

:bust_in_silhouette: Reply From: Avihai

Using android build template you can put this code in onCreate method of GodotApp.java:

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
    WindowManager.LayoutParams attrib = getWindow().getAttributes();
    attrib.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;

Looks like this issue was fixed in Godot 3.3

Xioor | 2021-05-20 02:56