Skip to content

Commit

Permalink
High-DPI support is now enabled by default in Chromium
Browse files Browse the repository at this point in the history
- Remove DPI entries from app.manifest
- Remove Cef.EnableHighDPISupport (Method will be removed in M113 (cefsharp/CefSharp#4417))

Issue cefsharp/CefSharp#4410
  • Loading branch information
amaitland committed Mar 7, 2023
1 parent 4f1320a commit 6cb9b3c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 34 deletions.
7 changes: 0 additions & 7 deletions CefSharp.MinimalExample.OffScreen/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
</security>
</trustInfo>

<asmv3:application>
<asmv3:windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Expand Down
10 changes: 2 additions & 8 deletions CefSharp.MinimalExample.WinForms/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ public static int Main(string[] args)
CefRuntime.SubscribeAnyCpuAssemblyResolver();
#endif

// Programmatically enable DPI Aweness
// Can also be done via app.manifest or app.config
// https://github.com/cefsharp/CefSharp/wiki/General-Usage#high-dpi-displayssupport
// If set via app.manifest this call will have no effect.
Cef.EnableHighDPISupport();

var settings = new CefSettings()
{
//By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
Expand All @@ -46,8 +40,8 @@ public static int Main(string[] args)
//Perform dependency check to make sure all relevant resources are in our output directory.
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null);

var browser = new BrowserForm();
Application.Run(browser);
Application.EnableVisualStyles();
Application.Run(new BrowserForm());

return 0;
}
Expand Down
12 changes: 0 additions & 12 deletions CefSharp.MinimalExample.WinForms/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@
</requestedPrivileges>
</security>
</trustInfo>

<!--
Enable DPI Awareness.
For those targeting .Net 4.7 or greater then configuring via app.config is recommended by Microsoft.
https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8#configuring-your-windows-forms-app-for-high-dpi-support
-->
<asmv3:application>
<asmv3:windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
Expand Down
7 changes: 0 additions & 7 deletions CefSharp.MinimalExample.Wpf/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
</security>
</trustInfo>

<asmv3:application>
<asmv3:windowsSettings>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with.
Expand Down

0 comments on commit 6cb9b3c

Please sign in to comment.