feat: Support ContactRect in X11 and Windows platform
What does the pull request do?
Adding the touch size support, which know as ContactRect in X11 and Windows platform.
What is the current behavior?
Miss the touch size feature.
What is the updated/expected behavior with this PR?
We can get the touch size from X11 and Windows.
I test the Avalonia Windows version by my two demo, the TouchSizeAvalonia demo and the WinUI demo.
I use the same physics for touch, and I can get the same result from TouchSizeAvalonia demo and the WinUI demo. That means this PR can have the same implementation as WinUI. Here's a video I recorded on my phone:
How was the solution implemented (if it's not obvious)?
Checklist
- [ ] Added unit tests (if possible)? I test pass with my demo
- [x] Added XML documentation to any related classes?
- [ ] Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation
Breaking changes
Add the ContactRect property to PointerPointProperties and changed the argument list in the constructor of PointerPointProperties.
Obsoletions / Deprecations
Fixed issues
Reference: https://github.com/AvaloniaUI/Avalonia/issues/1477
Also, according to https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.input.pointerpointproperties.contactrect?view=windows-app-sdk-1.5 the contact rect is supposed to be reported in DIPs
Thanks https://github.com/AvaloniaUI/Avalonia/pull/16705
I can call the _platform.Screens.ScreenFromPoint.
You can test this PR using the following package version. 11.2.999-cibuild0051457-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.2.999-cibuild0051461-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.2.999-cibuild0051475-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.2.999-cibuild0051477-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
You can test this PR using the following package version. 11.2.999-cibuild0051730-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]
Merging for 11.3 master branch. I will try to push more implementations over next months before 11.3 release.
Thank you @maxkatz6