You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The first point in StylusPlugin is wrong when use the high DPI #6415
.NET Core Version: (e.g. 3.0 Preview1, or daily build number, use dotnet --info)
Windows version: (winver)
Does the bug reproduce also in WPF for .NET Framework 4.8?: Yes/No
Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? If yes, please file the issue via the instructions here.
After #2891 , we call calculate the point with stylusDevice.CriticalActiveSource. But the stylusDevice.CriticalActiveSource must be null when first touch down, because the wpf do not touch any element and do not get the AcitveSource before first touch down.
Actual behavior:
All of the StylusPlugin will reviece the wrong coordinate point.
Expected behavior:
These points can be calculated correctly.
Minimal repro:
Before you try repro this issues, please make sure you own a touch screen.
Preparation:
Set the touch screen DPI to 150% (Not 100% is enough)
Step:
Create an empty WPF project.
Add the InkCanvas control to WPF project.
Run the project in the device with the touch screen and then try write an ink.
Actual behavior: you will find the first point in ink will skew, just as the image shows.
The other repro step: Create an empty WPF project and add the StylusPlugin and then output the point received.
When the wpf will set the stylusDevice.CriticalActiveSource ? The WispLogic.PreNotifyInput will call the stylusDevice.UpdateState method to calculate the ActiveSource in the Main UI Thread.
But the StylusPlugin is running in the Stylus Input thread and fast than the UI thread.
changed the title [-]The first point in StylusPlugin is wrong when use the hight DPI[/-][+]The first point in StylusPlugin is wrong when use the high DPI[/+]on Apr 14, 2022
@karelz Can I ask any plan about this issues? It will affect all touch applications.
I have cherry-picked my two PRs, #6428 and #6829, to build my private version of WPF. My application, which utilizes this private WPF version, has been running for almost two years now. Moreover, it has been performing well on millions of touch devices. This stands as a testament to the reliability of my PRs.
@lindexi Thanks a lot for your contributions. These PRs are currently not prioritized as the touch area isn't prioritized as of now from the team. We can prioritize it if the area receives more hits in terms of issues or more people running into this. Thanks again for the reliability data, I will try to get these 2 PRs in the next community test pass.
Activity
lindexi commentedon Apr 13, 2022
And I think the StylusLogic.GetAndCacheTransformToDeviceMatrix should return the first Matrix when the source is null.
wpf/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Input/Stylus/Common/StylusLogic.cs
Lines 417 to 435 in 2820580
lindexi commentedon Apr 14, 2022
When the wpf will set the
stylusDevice.CriticalActiveSource? TheWispLogic.PreNotifyInputwill call thestylusDevice.UpdateStatemethod to calculate the ActiveSource in the Main UI Thread.But the StylusPlugin is running in the
Stylus Inputthread and fast than the UI thread.[-]The first point in StylusPlugin is wrong when use the hight DPI[/-][+]The first point in StylusPlugin is wrong when use the high DPI[/+]Try fix the first point in StylusPlugin in high DPI
lindexi commentedon Apr 25, 2022
I tested the my app for a week. This issue has been fixed and no new issues have been introduced.
lindexi commentedon Nov 13, 2023
@karelz Can I ask any plan about this issues? It will affect all touch applications.
I have cherry-picked my two PRs, #6428 and #6829, to build my private version of WPF. My application, which utilizes this private WPF version, has been running for almost two years now. Moreover, it has been performing well on millions of touch devices. This stands as a testament to the reliability of my PRs.
singhashish-wpf commentedon Nov 14, 2023
@lindexi Thanks a lot for your contributions. These PRs are currently not prioritized as the touch area isn't prioritized as of now from the team. We can prioritize it if the area receives more hits in terms of issues or more people running into this. Thanks again for the reliability data, I will try to get these 2 PRs in the next community test pass.
lindexi commentedon Nov 14, 2023
Thank you @singhashish-wpf
Try fix the first point in StylusPlugin in high DPI (#6428)