Repository navigation
fix(viewer): keep a window turned the way its device's screen is - #87
Open
Mastersam07 wants to merge 2 commits into
Open
Mastersam07 wants to merge 2 commits into
Mastersam07 wants to merge 2 commits into
Conversation
Read from the display report after the screens announce a change: the active panel's layout rotation plus the angle its device type builds it in at. A reading has to hold before it counts, since a foldable's report goes through wrong turns on the way through a fold, and a lagging report must not count as a turn back.
A window only turned when its own rotate asked, so a turn from Device Hub or the guest left it sideways, and a turn the screen refused or a foldable never heard left it turned alone. It now follows the screen whoever turns the device, takes back a turn of its own the screen did not follow, and a rotate counts on from the turn last asked for so upside down on a Face ID phone is passed rather than asked for again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: A window now keeps turned the way its device's screen is, whoever turns the device. A turn from Device Hub or from the guest used to leave the window where it was, and a turn of our own that the screen refused (upside down on a Face ID phone) or that a foldable never received left the window turned while the screen was not. The window reads the display report after the screens announce a change, takes back its own turn if the screen does not follow, holds still while a foldable's hinge moves, and Rotate Left and Right count on from the turn last asked for, so upside down on a Face ID phone is passed on the next press.
Verification:
swift test: all unit tests pass, including 12 new ones for the watcher: the Duo's measured panel angles, a moment on the way through a fold not believed, a lagging report not counted as a turn back, a refused turn restated, a late turn reported once.devicectl device orientation set: the window followed both landscapes in 0.6 to 1.0 s and a click on its upper left landed on the upper left of the guest. Held upside down, and held sideways at the home screen: the screen stays upright and so does the window. Our own turn to upside down: the window showed it, went back to portrait when the screen refused, and the next rotate turned to landscape left.Follow-ups: