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
Doc - High-DPI support is now enabled by default in Chromium #4410
Starting in M108 High-DPI support is now enabled by default in Chromium.
Additionally, as a refactor to move responsibility out of the embedder
this change moves the existing EnableHighDPISupport calls in
chrome_exe_main_win.cc into the respective GpuMain &
BrowserMainRunnerImpl for the GPU & Browser processes.
For WPF the default would appear to be still System aware, WPF must be setting that somewhere internally (which makes sense as that's the default that WPF uses). So setting via the app.manifest is still required.
M111 will be the first version to rely on the Chromium default. The BrowserSubProcess no longer has app.manifest entries for DPI Awareness. Setting the DPI Awareness programmatically looks like it also influences the GPU process. See #2927 (comment)
There is a bitmap scaling that is used by Terminal Server and newer Windows versions for non-DPI aware (manifest not modified) application. Chromium instance is overriding that function by re-rendering the application (including windows that doesn't contain an embedded browser) causing it to resize and remove bitmap scaling.
In the context of WinForms. Setting DPI Awareness via app.manifest is no longer recommended when using .Net 4.8 or greater (this includes newer versions including .Net 8.0).
Hello UweKeim,
Thank you for your assistance and support. By calling the API function, I have successfully resolved the High-DPI issue.
After setting the value of DPI_AWARENESS_CONTEXT_UNAWARE to "-1", the WinForms application using CefSharp no longer experiences High-DPI problems.
I believe this is only a temporary solution.
Could you please confirm whether the latest version of CefSharp still does not provide an option to manually set whether to allow High-DPI?
Activity
High-DPI support is now enabled by default in Chromium
Core - High-DPI support is now enabled by default in Chromium.
amaitland commentedon Mar 13, 2023
For
WPFthe default would appear to be stillSystemaware,WPFmust be setting that somewhere internally (which makes sense as that's the default thatWPFuses). So setting via theapp.manifestis still required.Net Core - Remove EnableHighDPISupport from BrowserSubProcess
Net Core - Remove EnableHighDPISupport from BrowserSubProcess
[-]Doc - Chromium DPI Awareness Changes[/-][+]Doc - High-DPI support is now enabled by default in Chromium[/+]amaitland commentedon Mar 15, 2023
M111 will be the first version to rely on the
Chromiumdefault. TheBrowserSubProcessno longer hasapp.manifestentries forDPI Awareness. Setting theDPI Awarenessprogrammatically looks like it also influences the GPU process. See #2927 (comment)UweKeim commentedon May 9, 2023
I want to continue using CefSharp in a WinForms app that is currently not yet capable of running in High-DPI mode.
Is there still a way to fall back to non-High-DPI mode?
Update 1
It seems that disabling High-DPI through the application manifest did not help.
Instead, I removed all High-DPI related stuff from the manifest and instead did call the following right at the beginning of my application:
So far, it seems that this works.
(Context: I'm using CefSharp as "self-hosted" in a .NET 7 WinForms application, 64-bit)
Yokomoko commentedon May 10, 2023
I cannot seem to find this SetProcessDpiAwarenessContext method, do you know where this is? As I also need this.
UweKeim commentedon May 10, 2023
@Yokomoko Sure, it is P/Invoke:
My call then looks like:
4 remaining items
jquerijero commentedon May 24, 2024
There is a bitmap scaling that is used by Terminal Server and newer Windows versions for non-DPI aware (manifest not modified) application. Chromium instance is overriding that function by re-rendering the application (including windows that doesn't contain an embedded browser) causing it to resize and remove bitmap scaling.
amaitland commentedon May 29, 2024
ChromiumusesPer Monitor V2by default.You can override this behaviour as
There are some additional examples of setting
DPIawareness programmatically.amaitland commentedon Jun 25, 2024
In the context of WinForms. Setting
DPI Awarenessviaapp.manifestis no longer recommended when using.Net 4.8or greater (this includes newer versions including.Net 8.0).See https://learn.microsoft.com/en-us/dotnet/desktop/winforms/wfdev-diagnostics/wfac010?view=netdesktop-8.0 for Microsoft guidance regarding the compiler warning that will be raised.
Starting in
.Net Core 3.0you can use the WinForms specific API. Some examples (refer to the Microsoft documentation for more details)https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.application.sethighdpimode?view=windowsdesktop-8.0
lixiao23 commentedon Mar 24, 2025
@UweKeim
Hello UweKeim,
Thank you for your assistance and support. By calling the API function, I have successfully resolved the High-DPI issue.
After setting the value of DPI_AWARENESS_CONTEXT_UNAWARE to "-1", the WinForms application using CefSharp no longer experiences High-DPI problems.
I believe this is only a temporary solution.
Could you please confirm whether the latest version of CefSharp still does not provide an option to manually set whether to allow High-DPI?