Browse Source
Merge pull request #1959 from AvaloniaUI/fixes/1958-win32-enable-dpi-awareness
Call SetProcessDPIAware() on Win32 backend
pull/1957/merge
Jumar Macato
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
5 additions and
0 deletions
-
src/Windows/Avalonia.Win32/Interop/UnmanagedMethods.cs
-
src/Windows/Avalonia.Win32/Win32Platform.cs
|
|
|
@ -976,6 +976,9 @@ namespace Avalonia.Win32.Interop |
|
|
|
[DllImport("shcore.dll")] |
|
|
|
public static extern void GetScaleFactorForMonitor(IntPtr hMon, out uint pScale); |
|
|
|
|
|
|
|
[DllImport("user32.dll", SetLastError = true)] |
|
|
|
public static extern bool SetProcessDPIAware(); |
|
|
|
|
|
|
|
[DllImport("user32.dll")] |
|
|
|
public static extern IntPtr MonitorFromPoint(POINT pt, MONITOR dwFlags); |
|
|
|
|
|
|
|
|
|
|
|
@ -77,6 +77,8 @@ namespace Avalonia.Win32 |
|
|
|
|
|
|
|
public static void Initialize(bool deferredRendering = true) |
|
|
|
{ |
|
|
|
UnmanagedMethods.SetProcessDPIAware(); |
|
|
|
|
|
|
|
AvaloniaLocator.CurrentMutable |
|
|
|
.Bind<IClipboard>().ToSingleton<ClipboardImpl>() |
|
|
|
.Bind<IStandardCursorFactory>().ToConstant(CursorFactory.Instance) |
|
|
|
|