The function GetWindowSafeArea/GetRenderSafe
area returns incorrectly on one of my android devices. I am drawing a padded rectangle around the safe area for a visual representation on the top left of both of these devices.
On the left, the Samsung galaxy S20 shows a safe area box matching the camera notch.
On the right, the Oppo A9 device is told a 0x0 safe area is needed, even though there is a camera notch.
Strangely, on the Oppo A9, for a brief moment on startup, the safe area is correct, and then half a second later, SDL sends a message saying there is no notch.
Oppo logs on startup:
[debug] WindowSizeInPixels: 720x1461
[debug] GetWindowSize: 720x1461
[debug] WindowPixelDensity: 1
[info] safe area changed 0x64 720x1322 (scale 1.7)
Oppo half a second later:
[debug] resize event 720x1461 -> 720x1600
[info] safe area was 0x64 720x1322 (scale 1.7)
[info]. safe area changed 0x0 720x1600 (scale 1.7)
It’s almost like, the app, during startup, is told a smaller area is available (with notch), and then a larger area is available (without a notch). Perhaps it is related to the app requesting that it is a full screen (no android button area) app.
Is this a bug, or am I misunderstanding something? The documentation doesn’t seem to clarify why there is a GetWindowSafeArea
and a GetRenderSafeArea
but they seem to return the same values anyway?