Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swapping screens while in Landscape Mode forces Portrait layout (and vice versa) #387

Closed
1 task done
20excal07 opened this issue Aug 22, 2024 · 6 comments · Fixed by #390
Closed
1 task done

Swapping screens while in Landscape Mode forces Portrait layout (and vice versa) #387

20excal07 opened this issue Aug 22, 2024 · 6 comments · Fixed by #390
Labels
bug Something isn't working

Comments

@20excal07
Copy link

20excal07 commented Aug 22, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Affected Build(s)

2117

Description of Issue

This is more than likely an existing issue, but I want to elaborate further on why I think this is happening. First, a bit of context:

  • I tested this on a Nintendo Switch (hacked), running Android 10.
  • While the Switch is typically meant to be used in the Landscape layout, its screen is actually natively Portrait. Remember this, it'll be important later.

So to figure out why this issue exists, I ran 2 scenarios, altering the screen resolution using the SecondScreen app:

  1. Landscape Mode @ 1280x720 (the device is physically held in Landscape); let's call this state "LM-LP" ("P" for Physical)
    • This is the intended way to use the device.
  2. Landscape Mode @ 405x720 (the device is physically held in Portrait); let's call this state "LM-PP"
    • When I switch to this resolution, Android thinks that Portrait == Landscape / Landscape == Portrait, and the screen rotated appropriately, i.e. physically holding the device in Portrait puts it in Landscape, and vice versa.
    • To better clarify what I mean, if I use an orientation-forcing app like Rotation Control, having the app force Landscape in this resolution would require me to physically hold the device in Portrait to see the screen upright, and vice versa.

Now on the Lime3DS screen swap issue...

  1. In the LM-LP state:
    • With the device in its intended LM-LP state, attempting to swap the screen results in the app switching to the Portrait Screen Layout, and I needed to reach for the Landscape Screen Layout menu and click one of the layouts if I want to switch back to the Landscape Layout.
    • Conversely, when the device is physically rotated to Portrait, attempting to swap the screen results in the app switching to the Landscape Screen Layout.
  2. In the LM-PP state:
    • With the device in LM-PP (the "screen" is now Landscape), everything works as expected. The app shows the Landscape Screen Layout, and swapping the screen actually swaps the screen without switching to the wrong layout.
    • Similarly, when the device is physically rotated to Landscape (the "screen" is now Portrait), the app correctly uses the Portrait Screen Layout, and swapping the screen actually swaps etc etc etc.

Expected Behavior

I expect that the app should be able to detect the device's actual orientation regardless of what orientation the screen itself was natively made as, so the mis-swap wouldn't occur. In my case with the Nintendo Switch, even though I'm holding the device in Landscape and the screen is also in Landscape, the app clearly still thinks it's in Portrait, because the screen itself is natively Portrait.

Reproduction Steps

On a typical Android phone, you should be able to reproduce this by changing the screen resolution with the SecondScreen app. Change the resolution such that if the device's native resolution was 720x1280, then change it to become 720x405. This will then create a mismatch between the device's native orientation and the screen's actual orientation, and then hopefully this issue can be reproduced and fixed.

Log File

I'll provide one if needed, but hopefully the reproduction steps should suffice.

System Configuration

CPU: Quad-core ARM Cortex-A57 @ 1.78 GHz
GPU/Driver: Custom Nvidia GPU
RAM: 4 GB
OS: Android 10

@20excal07 20excal07 added the bug Something isn't working label Aug 22, 2024
@20excal07 20excal07 changed the title Swapping screens while in Landscape Mode forces Portrait layout Swapping screens while in Landscape Mode forces Portrait layout (and vice versa) Aug 22, 2024
@DavidRGriswold
Copy link
Collaborator

Okay the fact that this is still happening on 2117 despite it's internal refactor of portrait layouts is interesting. I'm going to try to dig into this.

Before I dig into his one question - when it forces it into Portrait mode on screen swap, is it actually rotated sideways into Portrait mode are are you just getting the portrait (vertical) layout in a landscape orientation?

@DavidRGriswold
Copy link
Collaborator

I wonder if running this on waydroid on my steam deck would give me the same behavior. I might try that for easier testing than trying to mess with my phone resolution.

@20excal07
Copy link
Author

Before I dig into his one question - when it forces it into Portrait mode on screen swap, is it actually rotated sideways into Portrait mode are are you just getting the portrait (vertical) layout in a landscape orientation?

Nope, not rotated. Just the Portrait layout in Landscape orientation, and vice versa.

@DavidRGriswold
Copy link
Collaborator

I think this build fixes it, can you download and try? It seemed to fix when I did my weird screen res testing.

https://github.com/Lime3DS/Lime3DS/actions/runs/10518347122/artifacts/1845219735

@SilverGreen93
Copy link

I had this exact issue with 2116, have not tested with 2117

@20excal07
Copy link
Author

I think this build fixes it, can you download and try? It seemed to fix when I did my weird screen res testing.

https://github.com/Lime3DS/Lime3DS/actions/runs/10518347122/artifacts/1845219735

Yup, that did it! The swapping works as intended now, in either display configuration. Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants