From 3d1503f9173364d3a1e7baa9a77fa06c66454fbe Mon Sep 17 00:00:00 2001 From: Miku AuahDark Date: Tue, 18 Jun 2024 11:03:15 +0800 Subject: [PATCH] Respect user orientation lock setting for resizable window. Cherry-picked from libsdl-org/SDL@3373667. --- .../app/src/main/java/org/libsdl/app/SDLActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/love/src/jni/SDL2/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/love/src/jni/SDL2/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java index 6a0a9be5..54d3a049 100644 --- a/love/src/jni/SDL2/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java +++ b/love/src/jni/SDL2/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java @@ -1023,8 +1023,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); @@ -1033,8 +1033,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);