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

Essentials fix DeviceDisplay and DeviceInfo #3738

Merged
merged 5 commits into from
Dec 17, 2021
Merged

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Dec 10, 2021

Description of Change

Convert over all of the static UWP static method calls to use PInvoke via the WindowHandle
Most of the code here is taken from

https://github.com/marb2000/DesktopWindow

The one unfortunate part of this code is the additional call from Maui.Core into Essentials through IVT. Taking from @marb2000 's examples the only way to react to the orientationchange/dpi change is by inspecting the windows messages. You can get pretty close by subscribing to the Change event on AppWindow but there are some edge cases (landscape to landscae flipped) where it looks like the Change event doesn't fire on AppWindow. Hopefully there will be some additional APIs added to WinUI down the road that let us sever this requirement.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)
  • Targets a single property for a single control (or intertwined few properties)
  • Adds the property to the appropriate interface
  • Avoids any changes not essential to the handler property
  • Adds the mapping to the PropertyMapper in the handler
  • Adds the mapping method to the WinUI, Android, iOS, and Standard aspects of the handler
  • Implements the actual property updates (usually in extension methods in the Platform section of Core)
  • Tags ported renderer methods with [PortHandler]
  • Adds an example of the property to the sample project (MainPage)
  • Adds the property to the stub class
  • Implements basic property tests in DeviceTests

Does this PR touch anything that might affect accessibility?

  • Does this PR introduce a new control? (If yes, add an example using SemanticProperties to the SemanticsPage)
  • APIs that modify focusability?
  • APIs that modify any text property on a control?
  • Does this PR modify view nesting or view arrangement in anyway?
  • Is there the smallest possibility that your PR will change accessibility?
  • I'm not sure, please help me

If any of the above checkboxes apply to your PR, then the PR will need to provide testing to demonstrate that accessibility still works.

@PureWeen PureWeen requested review from mattleibow and Redth December 10, 2021 23:40
@PureWeen PureWeen changed the title Essentials fix get idiom Essentials fix DeviceDisplay and DeviceInfo Dec 10, 2021
@Eilon Eilon added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Dec 11, 2021
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@PureWeen PureWeen force-pushed the essentials_fix_getIdiom branch from ed92163 to aedddc8 Compare December 13, 2021 20:58
@PureWeen PureWeen marked this pull request as ready for review December 13, 2021 21:03
@PureWeen PureWeen enabled auto-merge (squash) December 15, 2021 16:23
@Redth Redth disabled auto-merge December 17, 2021 15:46
@Redth Redth merged commit edd2d20 into main Dec 17, 2021
@Redth Redth deleted the essentials_fix_getIdiom branch December 17, 2021 15:46
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
@samhouts samhouts added the fixed-in-6.0.200-preview.12 Look for this fix in 6.0.200-preview.12! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info fixed-in-6.0.200-preview.12 Look for this fix in 6.0.200-preview.12!
Projects
None yet
5 participants