Skip to content

Adopt chromium methodology for determining tablet on Windows#22809

Merged
Foda merged 4 commits into
dotnet:mainfrom
daltzctr:fix-22093
Aug 15, 2024
Merged

Adopt chromium methodology for determining tablet on Windows#22809
Foda merged 4 commits into
dotnet:mainfrom
daltzctr:fix-22093

Conversation

@daltzctr

@daltzctr daltzctr commented Jun 3, 2024

Copy link
Copy Markdown
Contributor

Description of Change

Uses a more conservative approach of determining tablet mode on Windows. This approach is functionally identical to Chromium's implementation for determining tablet on Windows. Additionally, it adds a few documentation comments on the observed behavior.

I don't have a good idea on how to add a unit test for this, and it's a bit of an implicit breaking change (some users who had tablet layouts may have desktop layouts now), but I think that number of users affected will be near, or at 0.

Issues Fixed

Possibly fixes #22093

@daltzctr daltzctr requested a review from a team as a code owner June 3, 2024 20:13
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Jun 3, 2024
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hey there @daltzctr! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@daltzctr

daltzctr commented Jun 3, 2024

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree [company="CTR Electronics"]

@daltzctr

daltzctr commented Jun 3, 2024

Copy link
Copy Markdown
Contributor Author

@dotnet-policy-service agree company="CTR Electronics"

@daltzctr daltzctr marked this pull request as draft June 3, 2024 20:17
@daltzctr

daltzctr commented Jun 3, 2024

Copy link
Copy Markdown
Contributor Author

Marking as draft until I confirm a device that is Windows that should be tablet is still tablet (I will test on my Surface Pro 7). Reviews are still welcome.

Comment thread src/Essentials/src/DeviceInfo/DeviceInfo.uwp.cs Outdated
Comment thread src/Essentials/src/DeviceInfo/DeviceInfo.uwp.cs Outdated
@rmarinho rmarinho requested review from Foda, jfversluis and mattleibow and removed request for Eilon and StephaneDelcroix June 4, 2024 11:20
@daltzctr

daltzctr commented Jun 4, 2024

Copy link
Copy Markdown
Contributor Author

Surface Pro 7 (Windows 11): Keyboard Attached
Maui Controls Sample_aWmrzDIlzK

Surface Pro 7 (Windows 11): Keyboard Not-attached
Maui Controls Sample_Z4td4H16nN

Also tested on XPS 15 which now correctly reports as not-tablet,
Also tested on MSI GF65 which also reports as not-tablet (this always reported as not-tablet, but more devices are better)

@daltzctr daltzctr marked this pull request as ready for review June 4, 2024 15:22
@daltzctr

daltzctr commented Jun 4, 2024

Copy link
Copy Markdown
Contributor Author

This is ready for review and/or merge.

@jonathanpeppers

Copy link
Copy Markdown
Member

Can you share what device was wrong before (using stable MAUI)? Was it a Windows laptop that just always returned Tablet no matter what?

@daltzctr

daltzctr commented Jun 6, 2024

Copy link
Copy Markdown
Contributor Author

XPS 15 reports as tablet.

@daltzctr

daltzctr commented Jul 2, 2024

Copy link
Copy Markdown
Contributor Author

Can this get merged?

@daltzctr

daltzctr commented Jul 8, 2024

Copy link
Copy Markdown
Contributor Author

@Foda is this blocked on something?

@Foda Foda enabled auto-merge July 8, 2024 18:16
@daltzctr

daltzctr commented Aug 1, 2024

Copy link
Copy Markdown
Contributor Author

@Foda just a courtesy ping

@jfversluis

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@jfversluis jfversluis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations on being a .NET MAUI contributor!

@Foda Foda merged commit 76f12f7 into dotnet:main Aug 15, 2024
@daltzctr daltzctr deleted the fix-22093 branch August 15, 2024 13:49
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Aug 27, 2024
@samhouts samhouts added fixed-in-9.0.0-rc.1.24453.9 and removed fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Sep 20, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OnIdiom doesn't respect Desktop setting on Windows

7 participants