Gtk4DesktopHostOptionsExtensions class

Namespace Runic.Desktop.Gtk4 · Runic.Desktop.Gtk4 0.7.0-preview.5

public static class Gtk4DesktopHostOptionsExtensions

Applies the GTK 4 and WebKitGTK 6 Desktop profile.

Methods

WithGtk4

public static DesktopHostOptions WithGtk4(this DesktopHostOptions options)

Selects GTK 4 and WebKitGTK 6 for embedded Linux windows.

Parameters

options

The host options to copy.

Returns

A copy of options with the GTK 4 profile applied.

Exceptions

ArgumentException

options already has a different window host factory.

Remarks

Start the host with DesktopEventLoop.Run, which runs GTK on the Linux main thread. Sets LinuxDesktopOptions.EmbeddedBackend to LinuxEmbeddedBackend.Gtk4WebKit6 and, on Linux, DesktopHostOptions.WindowHostFactory to a Gtk4WindowHostFactory, so the two can no longer disagree. On Windows and macOS the platform's own embedded host stays in use; only the Linux selection is recorded.

WithGtk4

public static DesktopHostOptions WithGtk4(this DesktopHostOptions options, string applicationId)

Selects GTK 4 and WebKitGTK 6 for embedded Linux windows with an installed GTK application ID.

Parameters

options

The host options to copy.

applicationId

The reverse-DNS application ID. Inside Flatpak it must match the package ID.

Returns

A copy of options with the GTK 4 profile applied.

Exceptions

ArgumentException

applicationId is not a valid reverse-DNS ID (checked on every OS), or options already has a different window host factory.

Remarks

Like Gtk4DesktopHostOptionsExtensions.WithGtk4; the factory runs GTK with applicationId.