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

App needs to be on PerMonitorV2 DPI awareness to look properly #1

Closed
michael-hawker opened this issue May 7, 2019 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@michael-hawker
Copy link

After following step 3 of the Getting Started, I see the WebView2 offset:

image

WinVersion: 17763.437
NuGet: 0.8.149

Resolution/DPI: 2256x1504 @ 150% (Surface Laptop 2)

If I set my DPI to 100% it seems to work fine.

@david-risney
Copy link
Contributor

Thanks. I've opened a bug to track this. Perhaps we're missing some DPI awareness calls from the sample and documentation.

@david-risney david-risney added the bug Something isn't working label May 8, 2019
@liminzhu liminzhu added doc documentation issues sample issue and removed bug Something isn't working labels May 8, 2019
@jamesoli
Copy link
Contributor

jamesoli commented May 9, 2019

Hi, we're currently working on our documentation. It does indeed have to do with DPI awareness. To fix this, you need to be per monitor DPI aware. You can either set it in the manifest or add a call before you create the HWND:

SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);

@liminzhu liminzhu added the bug Something isn't working label May 10, 2019
@liminzhu liminzhu changed the title WebView2 Offset from Window when DPI not 100% App needs to be on PerMonitorV2 DPI awareness to look properly May 10, 2019
@liminzhu
Copy link
Member

Have a PR out to update the getting-started walkthrough - MicrosoftDocs/edge-developer@ec53ad2. Will leave this issue open as long as the behavior remains the same.

@liminzhu liminzhu removed doc documentation issues sample issue labels May 10, 2019
@liminzhu
Copy link
Member

Update - doc PR is merged.

peiche-jessica added a commit that referenced this issue Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants