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

TouchKeyboardNotifier - Does not work properly with Per Monitor V2 DPI Scaling #429

Open
aquinn39 opened this issue Jul 5, 2022 · 0 comments

Comments

@aquinn39
Copy link

aquinn39 commented Jul 5, 2022

With Per Monitor V2 DPI Scaling, the showingHandler code in TouchKeyboardNotifier does not return the correct occludedRect when the window which raised the event is on a non-primary monitor and that monitor's DPI scaling is different to the primary monitor's. It seems that the returned value assumes that it is coming from the primary monitor when it may not be. This issue may be in the underlying InputPane class this sample uses as it seems like that might be returning the incorrect values based on my investigation.

Note that this was tested with Per Monitor V2 Scaling enabled in the app manifest of a WPF app using both .Net Framework 4.8 and .Net Core 3.1. The WPF window itself scales fine and doesn't use bitmap stretching, but the occludedRect value produced in the showingHandler from this sample returns values that are too small or too big when the window which raised the event is on a non-primary monitor and that monitor's DPI scaling is different to the primary monitor's. When the WPF window is on a primary monitor, it seems to work fine regardless of DPI scaling.

Here is the expected behaviour (When WPF window is on a primary monitor):
image

And here it is on a secondary monitor whose DPI scaling is different from the primary monitors. The occludedRect is far to tall, resulting in most of the window being cut off when the content within it is resized to fit within the top of the touch keyboard and the top of the screen:
image

This was using Windows 11 but the issue occurs in Windows 10 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant