Skip to content

Commit 3d1503f

Browse files
committed
Respect user orientation lock setting for resizable window.
Cherry-picked from libsdl-org/SDL@3373667.
1 parent 65c4223 commit 3d1503f

File tree

1 file changed

+4
-4
lines changed
  • love/src/jni/SDL2/android-project/app/src/main/java/org/libsdl/app

1 file changed

+4
-4
lines changed

love/src/jni/SDL2/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1023,8 +1023,8 @@ public void setOrientationBis(int w, int h, boolean resizable, String hint)
10231023
/* No valid hint, nothing is explicitly allowed */
10241024
if (!is_portrait_allowed && !is_landscape_allowed) {
10251025
if (resizable) {
1026-
/* All orientations are allowed */
1027-
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
1026+
/* All orientations are allowed, respecting user orientation lock setting */
1027+
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
10281028
} else {
10291029
/* Fixed window and nothing specified. Get orientation from w/h of created window */
10301030
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)
10331033
/* At least one orientation is allowed */
10341034
if (resizable) {
10351035
if (is_portrait_allowed && is_landscape_allowed) {
1036-
/* hint allows both landscape and portrait, promote to full sensor */
1037-
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
1036+
/* hint allows both landscape and portrait, promote to full user */
1037+
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
10381038
} else {
10391039
/* Use the only one allowed "orientation" */
10401040
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);

0 commit comments

Comments
 (0)