Electron: Add support for per monitor DPI awareness

Created on 7 May 2016  ·  21Comments  ·  Source: electron/electron

Electron is currently system DPI aware. This leads to blurry text when monitors with different DPI settings are used. Implementing per monitor DPI awareness would fix this.

https://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx

bug platforwindows

Most helpful comment

Hi. I have written a very very small application for my website, here is the repo => https://github.com/Bohooslav/bolls-electron. So I have tried to deploy the application to Microsoft Partner Center and got the next error:

WARNING
DPIAwarenessValidation

Warning: The DPI-awareness validation test detected following Warnings:
File app\bollsbible.exe neither has PerMonitorV2 manifested in the manifest nor calls into DPI Awareness APIs for ex: user32!SetProcessDpiAwarenessContext or user32!SetThreadDpiAwarenessContext.
The app 33943CA21EBD1.BollsBible_0.1.3.0_x64__f6r55sbmr6tmj is not DPI Aware.
Impact if not fixed: Apps that are not DPI-aware but are running on a high-DPI display setting can exhibit incorrect scaling of UI elements, clipped text, and blurry images.
How to fix: It is recommended that you declare your app as DPI-aware in the app manifest. Otherwise, app should use DPI Awareness API calls for example:either SetProcessDpiAwarenessContext or SetThreadDpiAwarenessContext APIs.

I am using the latest version of electron 8.0.3 and electron builder to create appx that I wanna to deploy. Is this my error? If so what should I do, or can the issue be again opened? The application is hilariously simple, it is probably not my error.

All 21 comments

I don't think we should leave this issue open in Electron, it is a well-known Chromium bug and there is basically no way for us to fix it on Electron's side.

This is now resolved in Chromium

Reopen?

It should probably be reopened -- the latest Chromium now works great across split dpi monitors.

If the implementer needs help or guidance with the latest High DPI APIs in Windows 10, please feel free to hit me up and i'll connect you to the team.

Is this fixed with #8406?

Doesn't seem to be, I'm getting scaleFactor: 1.25 on both Displays returned from getAllDisplays() even though only one of them is set to 1.25.

Hi. I have written a very very small application for my website, here is the repo => https://github.com/Bohooslav/bolls-electron. So I have tried to deploy the application to Microsoft Partner Center and got the next error:

WARNING
DPIAwarenessValidation

Warning: The DPI-awareness validation test detected following Warnings:
File app\bollsbible.exe neither has PerMonitorV2 manifested in the manifest nor calls into DPI Awareness APIs for ex: user32!SetProcessDpiAwarenessContext or user32!SetThreadDpiAwarenessContext.
The app 33943CA21EBD1.BollsBible_0.1.3.0_x64__f6r55sbmr6tmj is not DPI Aware.
Impact if not fixed: Apps that are not DPI-aware but are running on a high-DPI display setting can exhibit incorrect scaling of UI elements, clipped text, and blurry images.
How to fix: It is recommended that you declare your app as DPI-aware in the app manifest. Otherwise, app should use DPI Awareness API calls for example:either SetProcessDpiAwarenessContext or SetThreadDpiAwarenessContext APIs.

I am using the latest version of electron 8.0.3 and electron builder to create appx that I wanna to deploy. Is this my error? If so what should I do, or can the issue be again opened? The application is hilariously simple, it is probably not my error.

I have encountered the same problem.
electron: 6.1.7
electron-builder: 22.2.0

This is an error issued by the Windows App Certification Kid, which is automatically performed after Microsoft Store submission, but about two weeks ago I was able to submit the app for review without errors. Looks like an error that has just happened recently.
Is there any modification that can be done on the electron side?

It should probably be reopened.

I just ran into the same issue with electron 8.0.2 and electron-builder 22.3.2.

@kevinsawicki @zcbenz

me too
neither has PerMonitorV2 manifested in the manifest nor calls into DPI Awareness APIs for ex: user32!SetProcessDpiAwarenessContext or user32!SetThreadDpiAwarenessContext.

Me too,same error since this week. Help us!!

I had sent issue to Microsoft, but did not reply

Me too, same issue with Microsoft Store validation. Electron 8.0.1

Same issue faced. Here is the exact error message from store.

DPIAwarenessValidation
Warning: The DPI-awareness validation test detected following Warnings:
File app\abc.exe neither has PerMonitorV2 manifested in the manifest nor calls into DPI Awareness APIs for ex: user32!SetProcessDpiAwarenessContext or user32!SetThreadDpiAwarenessContext.
The app abc_1.0.3.0_x64__s0tds78ffjpq8 is not DPI Aware.
Impact if not fixed: Apps that are not DPI-aware but are running on a high-DPI display setting can exhibit incorrect scaling of UI elements, clipped text, and blurry images.
How to fix: It is recommended that you declare your app as DPI-aware in the app manifest. Otherwise, app should use DPI Awareness API calls for example:either SetProcessDpiAwarenessContext or SetThreadDpiAwarenessContext APIs.
Writing High-DPI Apps

Faced the same, Electron 4.0.0. In our validation report, this issue is marked as a warning, not an error. Warnings should not fail certification in my understanding.

There was an update Windows Store validation recently.

Either there is a flaw in the update and it now incorrectly fails certification when it should not. In this case, we need to let Microsoft know, and kindly ask for a fix.

Or this issue is now considered an error by Windows Store and is incorrectly displayed as a warning in the report and we are screwed until it is fixed in Electron. But we can kindly ask Microsoft to temporarily lift the restriction.

I have sent an email to [email protected]. Also sent a twit to @MicrosoftStore. I suggest you do the same. If anyone knows a better support channel please post here.

Sorry, @electron, this issue seems to be the only place where we can communicate for the mo.

Just got an emal from support.

The issue was reported and we got notification that the fix should be deployed today. Could you please try submitting again and reach out to us if the WACK test still fails with the same error?

Thanks for reaching out to them @funkyOne! I tried resubmitting after reading your comment and just got back an approval notification.

@funkyOne Thank you!
Once again, I applied again and was able to release the application safely.
https://www.microsoft.com/ja-jp/p/client-for-google-todo-pro/9n82s1cc02pb?activetab=pivot:overviewtab

Was this page helpful?
0 / 5 - 0 ratings