Add handler for DPI-related benign GLFW error that prevents the 3D viewer from running

This commit is contained in:
wildcherry2 2025-12-18 14:30:29 -05:00
parent 5776444020
commit 16328f21b2

View File

@ -13,6 +13,8 @@ using FModel.Services;
using FModel.Settings;
using Newtonsoft.Json;
using Serilog.Sinks.SystemConsole.Themes;
using OpenTK.Windowing.Desktop;
using OpenTK.Windowing.GraphicsLibraryFramework;
using MessageBox = AdonisUI.Controls.MessageBox;
using MessageBoxImage = AdonisUI.Controls.MessageBoxImage;
using MessageBoxResult = AdonisUI.Controls.MessageBoxResult;
@ -123,6 +125,17 @@ public partial class App
Log.Information("{OS}", GetOperatingSystemProductName());
Log.Information("{RuntimeVer}", RuntimeInformation.FrameworkDescription);
Log.Information("Culture {SysLang}", CultureInfo.CurrentCulture);
GLFWProvider.SetErrorCallback((error, description) =>
{
if (error == ErrorCode.PlatformError && description.Contains("Win32: Failed to query monitor DPI"))
{
Log.Information("Absorbed benign DPI-related GLFW error for asset viewer.");
return;
}
throw new GLFWException(description, error);
});
}
private void AppExit(object sender, ExitEventArgs e)