Browse Source

OS compatibility check for SetProcessDpiAwareness (Windows 8.1 or newer) (#1816)

pull/1835/head
William David Cossey 8 years ago
committed by Nelson Carrillo
parent
commit
9555a914a9
  1. 7
      src/Windows/Avalonia.Win32/Win32Platform.cs

7
src/Windows/Avalonia.Win32/Win32Platform.cs

@ -50,7 +50,12 @@ namespace Avalonia.Win32
// Declare that this process is aware of per monitor DPI
if (UnmanagedMethods.ShCoreAvailable)
{
UnmanagedMethods.SetProcessDpiAwareness(UnmanagedMethods.PROCESS_DPI_AWARENESS.PROCESS_PER_MONITOR_DPI_AWARE);
var osVersion = Environment.OSVersion.Version;
if (osVersion.Major > 6 || (osVersion.Major == 6 && osVersion.Minor > 2))
{
UnmanagedMethods.SetProcessDpiAwareness(UnmanagedMethods.PROCESS_DPI_AWARENESS
.PROCESS_PER_MONITOR_DPI_AWARE);
}
}
CreateMessageWindow();

Loading…
Cancel
Save