axe-windows
axe-windows copied to clipboard
[Feature Request] NativeMethods.SetProcessDPIAware() should be reset after scan
Describe the bug
The call to SetProcessDPIAware() https://github.com/microsoft/axe-windows/blob/4a09d8728ed72fa9d307052a52a1dd4d9cee1258/src/Automation/SnapshotCommand.cs
Will affect any host application integrating axe-window into their product and it's not undone once the scan is completed. Either remove the call or bring the host application state to where it was before.
I think a good alternative to SetProcessDPIAware() is SetThreadDpiAwarenessContext(), which just changes the current thread and also allows you to switch the thread's awareness back to the way it was: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setthreaddpiawarenesscontext
What makes it a little more complicated is that SetThreadDpiAwarenessContext() would need to be called on any thread that could deal with coordinates. And a "using" statement can be used to force the thread back to the old state.
This issue has been marked as ready for team triage; we will triage it in our weekly review and update the issue. Thank you for contributing to Accessibility Insights!
This issue requires additional investigation by the Accessibility Insights team. When the issue is ready to be triaged again, we will update the issue with the investigation result and add "status: ready for triage". Thank you for contributing to Accessibility Insights!
Thanks for the feature request, @chabiss, marking this as needs investigation to analyze on our side.
This has been merged into main and will be included in an upcoming release of Axe.Windows. We'll close it out once we release the updated package to GitHub
@chabiss, This is included in version 2.0.0. Release details are at https://github.com/microsoft/axe-windows/releases/tag/v2.0.0. Closing this issue