Skip to main content

WaylandPlatformOptions Class

Definition

Namespace:Avalonia
Assembly:Avalonia.Wayland
Package:Avalonia.Wayland

Platform-specific options for the Wayland windowing backend, supplied via Avalonia.AvaloniaWaylandPlatformExtensions.UseWayland(Avalonia.AppBuilder).

public class WaylandPlatformOptions

Inheritance: object -> WaylandPlatformOptions

Constructors

NameDescription
WaylandPlatformOptionsNo summary available.

WaylandPlatformOptions Constructor

public WaylandPlatformOptions()

Properties

NameDescription
DisplayFdAn already-opened file descriptor for the Wayland display socket. When set, Avalonia.WaylandPlatformOptions.WlDisplayName is ignored and wl_display_connect_to_fd is used instead of wl_display_connect. Reconnects are automatically disabled in this mode because the fd is consumed by libwayland and cannot be reused.
EnableReconnectsWhether to automatically attempt to reconnect to the compositor if the connection is lost. Defaults to enabled. Reconnects are always disabled when Avalonia.WaylandPlatformOptions.DisplayFd is set, because the file descriptor is consumed by libwayland and cannot be reused.
ExternalGLibMainLoopExceptionLoggerIf Avalonia is in control of a run loop, we propagate exceptions by stopping the run loop frame and rethrowing an exception. However, if there is no Avalonia-controlled run loop frame, there is no way to report such exceptions, since allowing those to escape native->managed call boundary will likely brick GLib machinery since it's not aware of managed Exceptions. This property allows to inspect such exceptions before they will be ignored. Only used when Avalonia.WaylandPlatformOptions.UseGLibMainLoop is enabled.
ForceDrawnDecorationsSuppresses server-side decoration negotiation (zxdg_decoration_manager_v1): toplevels behave as if the compositor never advertised SSD support. Used primarily for testing the CSD path on compositors that would otherwise enforce server-side decorations (KWin, etc.). Equivalent in intent to X11PlatformOptions.ForceDrawnDecorations.
GlProfilesThe OpenGL/OpenGL ES versions to try, in priority order, when creating the GL context. The first profile the driver supports is used.
UseDmabufSwapchainWhether to use a dmabuf-based swapchain for GPU rendering. When null, the backend decides based on compositor and driver capabilities.
UseGLibMainLoopIf this option is set to true, a GMainLoop and GSource based dispatcher implementation will be used for the UI thread instead of the default managed one. Use this if you need to use GLib-based libraries on the main thread.
WlDisplayNameThe name of the Wayland display to connect to (e.g. wayland-0). When null, the WAYLAND_DISPLAY environment variable is used. Ignored when Avalonia.WaylandPlatformOptions.DisplayFd is set.

DisplayFd Property

An already-opened file descriptor for the Wayland display socket. When set, Avalonia.WaylandPlatformOptions.WlDisplayName is ignored and wl_display_connect_to_fd is used instead of wl_display_connect. Reconnects are automatically disabled in this mode because the fd is consumed by libwayland and cannot be reused.

public Nullable<int> DisplayFd { get; set; }

EnableReconnects Property

Whether to automatically attempt to reconnect to the compositor if the connection is lost. Defaults to enabled. Reconnects are always disabled when Avalonia.WaylandPlatformOptions.DisplayFd is set, because the file descriptor is consumed by libwayland and cannot be reused.

public Nullable<bool> EnableReconnects { get; set; }

ExternalGLibMainLoopExceptionLogger Property

If Avalonia is in control of a run loop, we propagate exceptions by stopping the run loop frame and rethrowing an exception. However, if there is no Avalonia-controlled run loop frame, there is no way to report such exceptions, since allowing those to escape native->managed call boundary will likely brick GLib machinery since it's not aware of managed Exceptions. This property allows to inspect such exceptions before they will be ignored. Only used when Avalonia.WaylandPlatformOptions.UseGLibMainLoop is enabled.

public Action<Exception> ExternalGLibMainLoopExceptionLogger { get; set; }

ForceDrawnDecorations Property

Suppresses server-side decoration negotiation (zxdg_decoration_manager_v1): toplevels behave as if the compositor never advertised SSD support. Used primarily for testing the CSD path on compositors that would otherwise enforce server-side decorations (KWin, etc.). Equivalent in intent to X11PlatformOptions.ForceDrawnDecorations.

public bool ForceDrawnDecorations { get; set; }

GlProfiles Property

The OpenGL/OpenGL ES versions to try, in priority order, when creating the GL context. The first profile the driver supports is used.

public System.Collections.Generic.IList<Avalonia.OpenGL.GlVersion> GlProfiles { get; set; }

UseDmabufSwapchain Property

Whether to use a dmabuf-based swapchain for GPU rendering. When null, the backend decides based on compositor and driver capabilities.

public Nullable<bool> UseDmabufSwapchain { get; set; }

UseGLibMainLoop Property

If this option is set to true, a GMainLoop and GSource based dispatcher implementation will be used for the UI thread instead of the default managed one. Use this if you need to use GLib-based libraries on the main thread.

public bool UseGLibMainLoop { get; set; }

WlDisplayName Property

The name of the Wayland display to connect to (e.g. wayland-0). When null, the WAYLAND_DISPLAY environment variable is used. Ignored when Avalonia.WaylandPlatformOptions.DisplayFd is set.

public string WlDisplayName { get; set; }