Closed Bug 1744687 Opened 1 year ago Closed 3 months ago

Screen.orientation.lock() support for Windows tablet

Categories

(Core :: DOM: Device Interfaces, enhancement)

Unspecified
Windows 10
enhancement

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(3 files)

SetDisplayAutoRotationPrefereces can lock screen orientation if tablet mode on Windows 10. IE11 and old (EdgeHTML's) Edge supported screen orientation lock by msLockOrientation API.

See Also: → 1677464

Since Windows tablet mode has a orientation lock API, this patch
implements orientation lock backend for Windows tablet mode.

GetAutoRotationState API recognizes whether orientation API is supported on
the device. So this fix uses this API to check orientation API capability.

Assignee: nobody → m_kato
Status: NEW → ASSIGNED

Since I have added Windows backend for lock orientation by Part 1. fix, I
would like to use it in screen.orientation.lock().

Since dom.screenorientation.allow-lock is still false on all platfroms even
if this fix is applied, orientation lock isn't turned on as default.

If lock orientation isn't supported in the device, the backend will throw
NS_ERROR_DOM_NOT_SUPPORTED_ERR.

Depends on D162451

Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/48b2c96d1c66
Part 1. Lock orientation backend for Windows Tablet. r=gsvelto
https://hg.mozilla.org/integration/autoland/rev/cb4c463e552f
Part 2. Use windows backend for screen.orientation.lock(). r=smaug
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch

This change seems to have broken my Windows build environment. I'm getting errors about AR_STATE not being defined, even though AR_STATE is definitely in WinUser.h (and windows.h should include that). I've updated Visual Studio, bootstrapped, etc., all to no avail. I don't have time to look into this properly right now, but I'll file a bug another day if I still can't get this working.

(In reply to James Teh [:Jamie] from comment #5)

This change seems to have broken my Windows build environment. I'm getting errors about AR_STATE not being defined, even though AR_STATE is definitely in WinUser.h (and windows.h should include that). I've updated Visual Studio, bootstrapped, etc., all to no avail. I don't have time to look into this properly right now, but I'll file a bug another day if I still can't get this working.

Thanks for notification and sorry. I guess that it seems to depend on Windows SDK version (the latest version of Windows 11 SDK). Fix is coming soon.

What's odd is that I ran the Visual Studio installer to get the latest updates. The SDK I have is 10.0.22621, which seems to be the latest. So, I don't understand why this doesn't work for me.

Now hal uses AR_STATE for screen orientation, so we should move it from
WinUtils.cpp to WinUtils.h for newer Windows 11 SDK.

Also, newer Windows SDK has to set WINVER to WIN8 to use auto rotation API.

Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/81a6f7f802a0
Part 3. Fix build error for newer Windows SDK. r=gsvelto
You need to log in before you can comment on or make changes to this bug.