# WaylandPlatformOptions

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-wayland/wayland_platform_options/struct-waylandplatformoptions/

**struct** · [`ferroui-wayland`](/docs/0.5.0/api/ferroui-wayland/) · v0.5.0

```rust
struct WaylandPlatformOptions
```

Platform-specific options for the Wayland windowing backend, registered
with the application builder before `use_wayland`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L11)

## Members

- [`app_id`](#struct_field-app_id)
- [`wl_display_name`](#struct_field-wl_display_name)
- [`display_fd`](#struct_field-display_fd)
- [`enable_reconnects`](#struct_field-enable_reconnects)
- [`force_drawn_decorations`](#struct_field-force_drawn_decorations)
- [`gl_profiles`](#struct_field-gl_profiles)
- [`use_dmabuf_swapchain`](#struct_field-use_dmabuf_swapchain)
- [`use_g_lib_main_loop`](#struct_field-use_g_lib_main_loop)
- [`external_g_lib_main_loop_exception_logger`](#struct_field-external_g_lib_main_loop_exception_logger)
- [`new`](#function-new)
- [`for_worker`](#function-for_worker)

<a id="struct_field-app_id"></a>

### app_id

```rust
app_id: Option<String>
```

The default AppId for Wayland windows (`xdg_toplevel.set_app_id`).
If `None`, no application identifier is sent. Defaults to the file name of the executable
(the reference: the name of the entry assembly).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L15)

<a id="struct_field-wl_display_name"></a>

### wl_display_name

```rust
wl_display_name: Option<String>
```

The name of the Wayland display to connect to (e.g. `wayland-0`). When `None`,
the `WAYLAND_DISPLAY` environment variable is used. Ignored when `display_fd` is set.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L19)

<a id="struct_field-display_fd"></a>

### display_fd

```rust
display_fd: Option<i32>
```

An already-opened file descriptor for the Wayland display socket.
When set, `wl_display_name` is ignored and the connection is made over
the descriptor instead of a socket found by name.
Reconnects are automatically disabled in this mode because the fd
is consumed by the connection and cannot be reused.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L26)

<a id="struct_field-enable_reconnects"></a>

### enable_reconnects

```rust
enable_reconnects: Option<bool>
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L31)

<a id="struct_field-force_drawn_decorations"></a>

### force_drawn_decorations

```rust
force_drawn_decorations: bool
```

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::force_drawn_decorations`.

Experimental, used mostly for testing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L41)

<a id="struct_field-gl_profiles"></a>

### gl_profiles

```rust
gl_profiles: Vec<ferroui_opengl::GlVersion>
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L45)

<a id="struct_field-use_dmabuf_swapchain"></a>

### use_dmabuf_swapchain

```rust
use_dmabuf_swapchain: Option<bool>
```

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

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L49)

<a id="struct_field-use_g_lib_main_loop"></a>

### use_g_lib_main_loop

```rust
use_g_lib_main_loop: bool
```

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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L54)

<a id="struct_field-external_g_lib_main_loop_exception_logger"></a>

### external_g_lib_main_loop_exception_logger

```rust
external_g_lib_main_loop_exception_logger: Option<std::rc::Rc<dyn Fn(&dyn Any + Send) -> ()>>
```

If the framework 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 run loop frame of the framework,
there is no way to report such exceptions, since allowing those to escape the native call boundary
will likely brick GLib machinery since it's not aware of them.
This property allows to inspect such exceptions before they will be ignored.
Only used when `use_g_lib_main_loop` is enabled.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L62)

<a id="function-new"></a>

### new

```rust
fn new() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L66)

<a id="function-for_worker"></a>

### for_worker

```rust
fn for_worker(self: &Self) -> WaylandWorkerOptions
```

What the worker thread needs of the options, as values.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Wayland/wayland_platform_options.rs#L99)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `NoneValue`
- `Instrument`
- `WithSubscriber`
- `Downcast`
- `Clone`
- `Default`
- `ErasedDestructor`
- `IntoEither`

## Availability

Extracted for `x86_64-unknown-linux-gnu`, `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
