parent
d70daae5d6
commit
1ce8b855c7
|
@ -52,10 +52,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
public override Size GetPanelNativeSize() => _presentationPanel.NativeSize;
|
||||
|
||||
protected override int GetGraphicsControlDpi()
|
||||
=> OSTailoredCode.IsUnixHost ? DisplayManagerBase.DEFAULT_DPI : GraphicsControlDpi;
|
||||
|
||||
// DeviceDpi is not available under mono, so we need to have this access wrapped in a separate function
|
||||
private int GraphicsControlDpi => _graphicsControl.DeviceDpi;
|
||||
{
|
||||
return OSTailoredCode.IsUnixHost
|
||||
? DEFAULT_DPI
|
||||
: Win32Imports.GetDpiForWindow(_graphicsControl.Handle);
|
||||
}
|
||||
|
||||
protected override Point GraphicsControlPointToClient(Point p) => _graphicsControl.PointToClient(p);
|
||||
|
||||
|
|
|
@ -7,7 +7,4 @@
|
|||
<loadFromRemoteSources enabled="true"/>
|
||||
<gcAllowVeryLargeObjects enabled="true"/>
|
||||
</runtime>
|
||||
<System.Windows.Forms.ApplicationConfigurationSection>
|
||||
<add key="DpiAwareness" value="PerMonitorV2" />
|
||||
</System.Windows.Forms.ApplicationConfigurationSection>
|
||||
</configuration>
|
||||
|
|
|
@ -67,5 +67,8 @@ namespace BizHawk.Common
|
|||
|
||||
[DllImport("user32.dll", ExactSpelling = true)]
|
||||
public static extern int TrackPopupMenuEx(IntPtr hmenu, TPM fuFlags, int x, int y, IntPtr hwnd, IntPtr lptpm);
|
||||
|
||||
[DllImport("user32.dll", ExactSpelling = true)]
|
||||
public static extern int GetDpiForWindow(IntPtr hwnd);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue