33using System . Reflection ;
44using Avalonia ;
55using SnapX . Avalonia ;
6- #if FREEBSD
7- using VelloSharp ;
8- using VelloSharp . Avalonia . Vello ;
9- #endif
106#if BROWSER
117using Avalonia . Browser ;
128#else
@@ -21,19 +17,21 @@ public static void Main(string[] args)
2117 {
2218 if ( args . Length != 0 && ( args [ 0 ] == "--version" || args [ 0 ] == "-v" ) )
2319 {
24- var informationalVersion = Assembly . GetExecutingAssembly ( )
25- . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( ) ?
26- . InformationalVersion ?? "Unknown" ;
20+ var informationalVersion =
21+ Assembly
22+ . GetExecutingAssembly ( )
23+ . GetCustomAttribute < AssemblyInformationalVersionAttribute > ( )
24+ ? . InformationalVersion ?? "Unknown" ;
2725
2826 Console . WriteLine ( informationalVersion ) ;
2927 return ;
3028 }
3129
3230 BuildAvaloniaApp ( )
3331#if ! BROWSER
34- . StartWithClassicDesktopLifetime ( args ) ;
32+ . StartWithClassicDesktopLifetime ( args ) ;
3533#else
36- . StartBrowserAppAsync ( "out" ) ;
34+ . StartBrowserAppAsync ( "out" ) ;
3735#endif
3836 }
3937
@@ -46,51 +44,44 @@ public static AppBuilder BuildAvaloniaApp()
4644#else
4745 if ( OperatingSystem . IsLinux ( ) || OperatingSystem . IsFreeBSD ( ) )
4846 {
49- builder = builder . With ( new FontManagerOptions
50- {
51- FontFallbacks = new List < FontFallback >
47+ builder = builder . With (
48+ new FontManagerOptions
5249 {
53- new ( ) { FontFamily = "Noto Sans" } ,
54- new ( ) { FontFamily = "Roboto" } ,
55- new ( ) { FontFamily = "Adwaita Sans" } ,
56- new ( ) { FontFamily = "Open Sans" } ,
57- new ( ) { FontFamily = "Segoe UI" } ,
58- new ( ) { FontFamily = "Inter" } , // kept for compatibility
59- new ( ) { FontFamily = "Helvetica Neue" } ,
50+ FontFallbacks = new List < FontFallback >
51+ {
52+ new ( ) { FontFamily = "Noto Sans" } ,
53+ new ( ) { FontFamily = "Roboto" } ,
54+ new ( ) { FontFamily = "Adwaita Sans" } ,
55+ new ( ) { FontFamily = "Open Sans" } ,
56+ new ( ) { FontFamily = "Segoe UI" } ,
57+ new ( ) { FontFamily = "Inter" } , // kept for compatibility
58+ new ( ) { FontFamily = "Helvetica Neue" } ,
59+ } ,
6060 }
61- } ) ;
61+ ) ;
6262 }
6363
6464 builder = builder . LogToTrace ( ) ;
6565
6666 var x11Options = new X11PlatformOptions
6767 {
68- RenderingMode = [ X11RenderingMode . Vulkan , X11RenderingMode . Egl , X11RenderingMode . Glx , X11RenderingMode . Software ] ,
68+ RenderingMode =
69+ [
70+ X11RenderingMode . Vulkan ,
71+ X11RenderingMode . Egl ,
72+ X11RenderingMode . Glx ,
73+ X11RenderingMode . Software ,
74+ ] ,
6975 UseRetainedFramebuffer = true ,
70- OverlayPopups = true
76+ OverlayPopups = true ,
7177 } ;
7278
73- if ( OperatingSystem . IsFreeBSD ( ) || Environment . GetEnvironmentVariable ( "SNAPX_PRETEND_FREEBSD" ) is not null )
74- {
75- #if FREEBSD
76- // Region selector yields a black screen if not using software. Still ULTRA GPU ACCELERATED!
77- x11Options . RenderingMode = [ X11RenderingMode . Software ] ;
78- builder = builder
79- . UseSkia ( )
80- . UseX11 ( )
81- . UseVello ( new VelloPlatformOptions { FramesPerSecond = 240 , PresentMode = PresentMode . Fifo , Antialiasing = AntialiasingMode . Msaa16 } )
82- . With ( x11Options ) ;
83- #endif
84- }
85- else
86- {
87- builder = builder
88- . UsePlatformDetect ( )
89- . UseManagedSystemDialogs ( )
90- . With ( x11Options )
91- . With ( new AvaloniaNativePlatformOptions { OverlayPopups = true } )
92- . With ( new Win32PlatformOptions { OverlayPopups = true } ) ;
93- }
79+ builder = builder
80+ . UsePlatformDetect ( )
81+ . UseManagedSystemDialogs ( )
82+ . With ( x11Options )
83+ . With ( new AvaloniaNativePlatformOptions { OverlayPopups = true } )
84+ . With ( new Win32PlatformOptions { OverlayPopups = true } ) ;
9485
9586 return builder ;
9687#endif
0 commit comments