Android: left inset ignores the back-gesture zone

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-13 11:45:47 +09:00
co-authored by Claude Opus 5.5
parent ae713a0772
commit 445dd06048
2 changed files with 16 additions and 3 deletions
@@ -41,8 +41,10 @@ public class Ava2Activity extends SDLActivity {
/**
* SDL folds the system-gesture insets into the safe area. In landscape fullscreen the status bar
* is hidden, but its swipe-down gesture zone still reported a 120 px top inset, which pushed the
* top HUD row down. Keep SDL's left/right/bottom; take the top only from what really covers the
* screen there (display cutout and visible system bars).
* top HUD row down. The left inset is the same story: Android measures the back-gesture zone
* (90 px) from the cutout edge, so it reported 120 + 90 px and the left HUD column sat far from
* the edge. Taps in the gesture zone still reach the app, so take top and left only from what
* really covers the screen (display cutout and visible system bars); keep SDL's right/bottom.
*/
static class Ava2Surface extends SDLSurface {
Ava2Surface(Context context) {
@@ -60,7 +62,7 @@ public class Ava2Activity extends SDLActivity {
WindowInsets.Type.displayCutout());
Insets covering = insets.getInsets(WindowInsets.Type.systemBars() |
WindowInsets.Type.displayCutout());
SDLActivity.onNativeInsetsChanged(combined.left, combined.right, covering.top, combined.bottom);
SDLActivity.onNativeInsetsChanged(covering.left, combined.right, covering.top, combined.bottom);
}
return result;
}