Avalonia icon indicating copy to clipboard operation
Avalonia copied to clipboard

feat: Support ContactRect in X11 and Windows platform

Open lindexi opened this issue 1 year ago • 6 comments

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:

TouchSize.mp4

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

lindexi avatar Jul 27 '24 08:07 lindexi

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

kekekeks avatar Jul 27 '24 09:07 kekekeks

Thanks https://github.com/AvaloniaUI/Avalonia/pull/16705

I can call the _platform.Screens.ScreenFromPoint.

lindexi avatar Aug 24 '24 07:08 lindexi

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]

avaloniaui-bot avatar Aug 24 '24 07:08 avaloniaui-bot

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]

avaloniaui-bot avatar Aug 24 '24 09:08 avaloniaui-bot

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]

avaloniaui-bot avatar Aug 26 '24 02:08 avaloniaui-bot

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]

avaloniaui-bot avatar Aug 26 '24 07:08 avaloniaui-bot

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]

avaloniaui-bot avatar Sep 10 '24 03:09 avaloniaui-bot

Merging for 11.3 master branch. I will try to push more implementations over next months before 11.3 release.

maxkatz6 avatar Oct 06 '24 21:10 maxkatz6

Thank you @maxkatz6

lindexi avatar Oct 08 '24 06:10 lindexi