File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
src/Uno.UI.Runtime.Skia.Gtk Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,11 @@ public void Run()
87
87
{
88
88
Windows . UI . Xaml . Documents . Inline . ApplyHarfbuzzWorkaround ( ) ;
89
89
90
- Gtk . Application . Init ( ) ;
90
+ if ( ! InitializeGtk ( ) )
91
+ {
92
+ return ;
93
+ }
94
+
91
95
SetupTheme ( ) ;
92
96
93
97
ApiExtensibility . Register ( typeof ( Uno . ApplicationModel . Core . ICoreApplicationExtension ) , o => new CoreApplicationExtension ( o ) ) ;
@@ -137,6 +141,23 @@ public void Run()
137
141
Gtk . Application . Run ( ) ;
138
142
}
139
143
144
+ private bool InitializeGtk ( )
145
+ {
146
+ try
147
+ {
148
+ Gtk . Application . Init ( ) ;
149
+ return true ;
150
+ }
151
+ catch ( System . TypeInitializationException e )
152
+ {
153
+ if ( this . Log ( ) . IsEnabled ( LogLevel . Error ) )
154
+ {
155
+ this . Log ( ) . Error ( $ "Unable to initialize Gtk, visit https://aka.platform.uno/gtk-install for more information.", e ) ;
156
+ }
157
+ return false ;
158
+ }
159
+ }
160
+
140
161
void DispatchNative ( System . Action d )
141
162
{
142
163
if ( Gtk . Application . EventsPending ( ) )
You can’t perform that action at this time.
0 commit comments