]> granicus.if.org Git - handbrake/commitdiff
Enabled "Per monitor DPI awareness"
authorWaterflames <wouterdekrsmckr@gmail.com>
Sat, 18 Feb 2017 13:11:57 +0000 (14:11 +0100)
committerScott <sr55@users.noreply.github.com>
Sat, 18 Feb 2017 13:34:01 +0000 (13:34 +0000)
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

win/CS/HandBrakeWPF/app.config
win/CS/HandBrakeWPF/app.manifest

index 5ea845f32260a86be6e83a443524fdc0061c2a5c..4fee91d0a8a1f809d20971c47e8261ba19076d43 100644 (file)
@@ -3,4 +3,8 @@
   <startup>\r
     <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>\r
   </startup>\r
+  <runtime>\r
+    <!-- Required for "Per monitor DPI scaling" on .NET < 4.6.2 -->\r
+    <AppContextSwitchOverrides value="Switch.System.Windows.DoNotScaleForDpiChanges=false"/>\r
+  </runtime>\r
 </configuration>\r
index dba44e97460af24984cb82dd9f9a83b7f102d372..389e81f24d57c3cb966325ff391a9ef55020c888 100644 (file)
     </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>