From 919240a25e6e1a2d8e298bd07f0d989577503e0f Mon Sep 17 00:00:00 2001 From: Oxdeception <9624-oxdeception@users.noreply.gitgud.io> Date: Mon, 26 Aug 2024 12:24:32 -0400 Subject: [PATCH] Android: Use SCREEN_ORIENTATION_FULL_USER instead of SCREEN_ORIENTATION_FULL_SENSOR For Resizable Window. Fixes #1737 Pulled from https://github.com/libsdl-org/SDL/pull/10046 --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/android/template/app/src/main/java/org/libsdl/app/SDLActivity.java b/templates/android/template/app/src/main/java/org/libsdl/app/SDLActivity.java index a34371404e..898a87529c 100644 --- a/templates/android/template/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/templates/android/template/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -965,8 +965,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint) /* No valid hint, nothing is explicitly allowed */ if (!is_portrait_allowed && !is_landscape_allowed) { if (resizable) { - /* All orientations are allowed */ - req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR; + /* All orientations are allowed, respecting user orientation lock setting */ + req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER; } else { /* Fixed window and nothing specified. Get orientation from w/h of created window */ req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); @@ -975,8 +975,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint) /* At least one orientation is allowed */ if (resizable) { if (is_portrait_allowed && is_landscape_allowed) { - /* hint allows both landscape and portrait, promote to full sensor */ - req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR; + /* hint allows both landscape and portrait, promote to full user */ + req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER; } else { /* Use the only one allowed "orientation" */ req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);