File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/Uno.UI.Runtime.Skia.Win32.Support Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,10 @@ internal static void Init()
3636 //
3737 // This call must be made BEFORE any window is initialized.
3838
39- var success = PInvoke . SetProcessDpiAwarenessContext ( DPI_AWARENESS_CONTEXT . DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ) ;
40- if ( ! success ) { typeof ( DpiBootstrap ) . LogError ( ) ? . Error ( $ "{ nameof ( PInvoke . SetProcessDpiAwarenessContext ) } failed: { GetErrorMessage ( ) } ") ; }
39+ // This call won't succeed when running directly from the executable generated by the compiler. It will only
40+ // work when the program is run as `dotnet mainassembly.dll`. In case of failure, we depend on
41+ // the SetThreadDpiAwarenessContext made during the first window init.
42+ PInvoke . SetProcessDpiAwarenessContext ( DPI_AWARENESS_CONTEXT . DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ) ;
4143 }
4244
4345 private static string GetErrorMessage ( ) => GetErrorMessage ( ( uint ) Marshal . GetLastWin32Error ( ) ) ;
You can’t perform that action at this time.
0 commit comments