@@ -58,7 +58,7 @@ public void Initialize(X11PlatformOptions options)
58
58
DeferredDisplay = XOpenDisplay ( IntPtr . Zero ) ;
59
59
if ( DeferredDisplay == IntPtr . Zero )
60
60
throw new Exception ( "XOpenDisplay failed" ) ;
61
-
61
+
62
62
OrphanedWindow = XCreateSimpleWindow ( Display , XDefaultRootWindow ( Display ) , 0 , 0 , 1 , 1 , 0 , IntPtr . Zero ,
63
63
IntPtr . Zero ) ;
64
64
XError . Init ( ) ;
@@ -86,7 +86,7 @@ public void Initialize(X11PlatformOptions options)
86
86
. Bind < IPlatformIconLoader > ( ) . ToConstant ( new X11IconLoader ( ) )
87
87
. Bind < IMountedVolumeInfoProvider > ( ) . ToConstant ( new LinuxMountedVolumeInfoProvider ( ) )
88
88
. Bind < IPlatformLifetimeEventsImpl > ( ) . ToConstant ( new X11PlatformLifetimeEvents ( this ) ) ;
89
-
89
+
90
90
Screens = X11Screens = new X11Screens ( this ) ;
91
91
if ( Info . XInputVersion != null )
92
92
{
@@ -126,7 +126,7 @@ public ITrayIconImpl CreateTrayIcon()
126
126
127
127
return dbusTrayIcon ;
128
128
}
129
-
129
+
130
130
public IWindowImpl CreateWindow ( )
131
131
{
132
132
return new X11Window ( this , null ) ;
@@ -145,11 +145,11 @@ private static bool EnableIme(X11PlatformOptions options)
145
145
var avaloniaImModule = Environment . GetEnvironmentVariable ( "AVALONIA_IM_MODULE" ) ;
146
146
if ( avaloniaImModule == "none" )
147
147
return false ;
148
-
148
+
149
149
// Use value from options when specified
150
150
if ( options . EnableIme . HasValue )
151
151
return options . EnableIme . Value ;
152
-
152
+
153
153
// Automatically enable for CJK locales
154
154
var lang = Environment . GetEnvironmentVariable ( "LANG" ) ;
155
155
var isCjkLocale = lang != null &&
@@ -168,7 +168,7 @@ private static bool ShouldUseXim()
168
168
|| Environment . GetEnvironmentVariable ( "GTK_IM_MODULE" ) == "none"
169
169
|| Environment . GetEnvironmentVariable ( "QT_IM_MODULE" ) == "none" )
170
170
return true ;
171
-
171
+
172
172
// Check if XIM is configured
173
173
var modifiers = Environment . GetEnvironmentVariable ( "XMODIFIERS" ) ;
174
174
if ( modifiers == null )
@@ -177,16 +177,16 @@ private static bool ShouldUseXim()
177
177
return false ;
178
178
if ( ! modifiers . Contains ( "@im=" ) )
179
179
return false ;
180
-
180
+
181
181
// Check if we are configured to use it
182
182
if ( Environment . GetEnvironmentVariable ( "GTK_IM_MODULE" ) == "xim"
183
183
|| Environment . GetEnvironmentVariable ( "QT_IM_MODULE" ) == "xim"
184
184
|| Environment . GetEnvironmentVariable ( "AVALONIA_IM_MODULE" ) == "xim" )
185
185
return true ;
186
-
186
+
187
187
return false ;
188
188
}
189
-
189
+
190
190
private static IPlatformGraphics InitializeGraphics ( X11PlatformOptions opts , X11Info info )
191
191
{
192
192
if ( opts . RenderingMode is null || ! opts . RenderingMode . Any ( ) )
@@ -200,7 +200,7 @@ private static IPlatformGraphics InitializeGraphics(X11PlatformOptions opts, X11
200
200
{
201
201
return null ;
202
202
}
203
-
203
+
204
204
if ( renderingMode == X11RenderingMode . Glx )
205
205
{
206
206
if ( GlxPlatformGraphics . TryCreate ( info , opts . GlProfiles ) is { } glx )
@@ -252,13 +252,13 @@ public enum X11RenderingMode
252
252
/// Enables native Linux EGL rendering.
253
253
/// </summary>
254
254
Egl = 3 ,
255
-
255
+
256
256
/// <summary>
257
257
/// Enables Vulkan rendering
258
258
/// </summary>
259
259
Vulkan = 4
260
260
}
261
-
261
+
262
262
/// <summary>
263
263
/// Platform-specific options which apply to Linux.
264
264
/// </summary>
@@ -294,23 +294,23 @@ public class X11PlatformOptions
294
294
/// The default value is true.
295
295
/// </summary>
296
296
public bool UseDBusFilePicker { get ; set ; } = true ;
297
-
297
+
298
298
/// <summary>
299
299
/// Determines whether to use IME.
300
300
/// IME would be enabled by default if the current user input language is one of the following: Mandarin, Japanese, Vietnamese or Korean.
301
301
/// </summary>
302
302
/// <remarks>
303
- /// Input method editor is a component that enables users to generate characters not natively available
303
+ /// Input method editor is a component that enables users to generate characters not natively available
304
304
/// on their input devices by using sequences of characters or mouse operations that are natively available on their input devices.
305
305
/// </remarks>
306
306
public bool ? EnableIme { get ; set ; } = true ;
307
307
308
308
/// <summary>
309
309
/// Determines whether to use Input Focus Proxy.
310
310
/// The default value is false.
311
- /// </summary>
311
+ /// </summary>
312
312
public bool EnableInputFocusProxy { get ; set ; }
313
-
313
+
314
314
/// <summary>
315
315
/// Determines whether to enable support for the
316
316
/// X Session Management Protocol.
@@ -320,7 +320,7 @@ public class X11PlatformOptions
320
320
/// Linux systems that uses Xorg. This enables apps to control how they
321
321
/// can control and/or cancel the pending shutdown requested by the user.
322
322
/// </remarks>
323
- public bool EnableSessionManagement { get ; set ; } =
323
+ public bool EnableSessionManagement { get ; set ; } =
324
324
Environment . GetEnvironmentVariable ( "AVALONIA_X11_USE_SESSION_MANAGEMENT" ) != "0" ;
325
325
326
326
/// <summary>
@@ -353,7 +353,7 @@ public class X11PlatformOptions
353
353
"SVGA3D"
354
354
} ;
355
355
356
-
356
+
357
357
public string WmClass { get ; set ; }
358
358
359
359
/// <summary>
@@ -368,7 +368,7 @@ public class X11PlatformOptions
368
368
/// Retain window framebuffer contents if using CPU rendering mode.
369
369
/// This will keep an offscreen bitmap for each window with contents of the previous frame
370
370
/// While improving performance by saving a blit, it will increase memory consumption
371
- /// if you have many windows
371
+ /// if you have many windows
372
372
/// </summary>
373
373
public bool ? UseRetainedFramebuffer { get ; set ; }
374
374
@@ -378,7 +378,7 @@ public class X11PlatformOptions
378
378
/// Use this if you need to use GLib-based libraries on the main thread
379
379
/// </summary>
380
380
public bool UseGLibMainLoop { get ; set ; }
381
-
381
+
382
382
/// <summary>
383
383
/// If Avalonia is in control of a run loop, we propagate exceptions by stopping the run loop frame
384
384
/// and rethrowing an exception. However, if there is no Avalonia-controlled run loop frame,
@@ -387,7 +387,7 @@ public class X11PlatformOptions
387
387
/// This property allows to inspect such exceptions before they will be ignored
388
388
/// </summary>
389
389
public Action < Exception > ? ExterinalGLibMainLoopExceptionLogger { get ; set ; }
390
-
390
+
391
391
public X11PlatformOptions ( )
392
392
{
393
393
try
0 commit comments