remove app.config dpi stuff

mono does not like this (fixes #4002)
This commit is contained in:
CasualPokePlayer 2024-08-30 17:11:22 -07:00
parent d70daae5d6
commit 1ce8b855c7
3 changed files with 8 additions and 7 deletions

View File

@ -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);

View File

@ -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>

View File

@ -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);
}
}