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
optionsThe host options to copy.
Returns
A copy of options with the GTK 4 profile applied.
Exceptions
ArgumentExceptionoptionsalready 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
optionsThe host options to copy.
applicationIdThe reverse-DNS application ID. Inside Flatpak it must match the package ID.
Returns
A copy of options with the GTK 4 profile applied.
Exceptions
ArgumentExceptionapplicationIdis not a valid reverse-DNS ID (checked on every OS), oroptionsalready has a different window host factory.
Remarks
Like Gtk4DesktopHostOptionsExtensions.WithGtk4; the factory runs GTK with applicationId.