diff options
author | Waterflames <[email protected]> | 2017-02-18 14:11:57 +0100 |
---|---|---|
committer | Scott <[email protected]> | 2017-02-18 13:34:01 +0000 |
commit | 9780502d6e2ed7bb8c41b8e732162541f7f871c5 (patch) | |
tree | cbf912bff4c7e158d460ac480714a6317171b9ec /win | |
parent | fe7712362d7fe00b756d64220c187674bb157c8c (diff) |
Enabled "Per monitor DPI awareness"
This commit adds entries to app.config and app.manifest to enable per
monitor DPI awareness in Windows 10. The application will behave as
before on platforms that do not support this.
The implementation was done using official Microsoft documentation:
https://github.com/Microsoft/WPF-Samples/tree/master/PerMonitorDPI
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrakeWPF/app.config | 4 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/app.manifest | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/app.config b/win/CS/HandBrakeWPF/app.config index 5ea845f32..4fee91d0a 100644 --- a/win/CS/HandBrakeWPF/app.config +++ b/win/CS/HandBrakeWPF/app.config @@ -3,4 +3,8 @@ <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
+ <runtime>
+ <!-- Required for "Per monitor DPI scaling" on .NET < 4.6.2 -->
+ <AppContextSwitchOverrides value="Switch.System.Windows.DoNotScaleForDpiChanges=false"/>
+ </runtime>
</configuration>
diff --git a/win/CS/HandBrakeWPF/app.manifest b/win/CS/HandBrakeWPF/app.manifest index dba44e974..389e81f24 100644 --- a/win/CS/HandBrakeWPF/app.manifest +++ b/win/CS/HandBrakeWPF/app.manifest @@ -60,4 +60,14 @@ </dependentAssembly> </dependency> + <application xmlns="urn:schemas-microsoft-com:asm.v3"> + <windowsSettings> + <!-- The combination of below two tags have the following effect : + 1) Per-Monitor for >= Windows 10 Anniversary Update + 2) System < Windows 10 Anniversary Update --> + <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"> PerMonitor</dpiAwareness> + <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> + </windowsSettings> + </application> + </assembly> |