DesktopWindowOptions record

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

public sealed record DesktopWindowOptions : IEquatable<DesktopWindowOptions>

Inherits or implements IEquatable.

Configures one browser or embedded-WebView presentation.

Constructors

DesktopWindowOptions

public DesktopWindowOptions()

No documentation.

Properties

AllowedPermissions

public DesktopPermissionGrant AllowedPermissions { get; init; }

Gets the sensitive permissions granted to the presentation; none by default.

Browser

public BrowserKind Browser { get; init; }

Gets the presentation: the platform's embedded WebView by default, or an installed browser.

Remarks

On Linux, the embedded WebView requires DesktopHostOptions.Linux to select a toolkit.

BrowserArguments

public string? BrowserArguments { get; init; }

Gets additional command-line arguments for the browser or WebView2 runtime.

Remarks

The string is split like a command line and appended to the launch arguments. When set, installed browsers no longer receive Runic Desktop's default isolation flags. The macOS and GTK 3 embedded windows ignore it.

Centered

public bool Centered { get; init; }

Gets whether the embedded window opens centered on the screen, replacing DesktopWindowOptions.X and DesktopWindowOptions.Y.

ConfirmCloseAsync

public Func<CancellationToken, ValueTask<bool>>? ConfirmCloseAsync { get; init; }

Asynchronously approves a user close request. Requires an embedded host without browser fallback.

Remarks

Runs on the thread pool. Return false to keep the window open. Exceptions and cancellation deny closing. Concurrent requests share a decision. The token is cancelled when the window is forcibly closed. CloseAsync and disposal bypass confirmation; marshal native UI work to its owning thread.

Frameless

public bool Frameless { get; init; }

Gets whether the embedded window opens without a title bar and border.

Height

public uint Height { get; init; }

Gets the initial window height in pixels. Defaults to 600.

Hidden

public bool Hidden { get; init; }

Gets whether the presentation opens without a visible window.

Remarks

Embedded windows are created hidden; installed browsers run headless.

HighContrast

public bool? HighContrast { get; init; }

Gets whether the presentation reports a high-contrast theme to the page, or null to follow DesktopPlatform.IsHighContrast.

IconFile

public string? IconFile { get; init; }

Gets the path of the embedded window's icon file, or null for the default icon.

Kiosk

public bool Kiosk { get; init; }

Gets whether the presentation opens in full-screen kiosk mode without window decorations.

MinimumHeight

public uint? MinimumHeight { get; init; }

Gets the minimum window height in pixels, or null for no minimum.

Remarks

Applies only together with DesktopWindowOptions.MinimumWidth, and only to embedded windows.

MinimumWidth

public uint? MinimumWidth { get; init; }

Gets the minimum window width in pixels, or null for no minimum.

Remarks

Applies only together with DesktopWindowOptions.MinimumHeight, and only to embedded windows.

PresentationPolicy

public DesktopPresentationPolicy PresentationPolicy { get; init; }

Gets whether the window may fall back to an installed browser when the embedded WebView cannot open.

Remarks

Defaults to DesktopPresentationPolicy.RequestedOnly. With DesktopPresentationPolicy.EmbeddedThenBrowser, the embedded WebView is tried first and DesktopWindowOptions.Browser selects the fallback browser, where BrowserKind.Embedded means BrowserKind.Any. The fallback opens without DesktopWindowOptions.AllowedPermissions.

ProfileName

public string? ProfileName { get; init; }

Gets the name of an existing Firefox profile to open.

Remarks

Only Firefox applies it, and only when DesktopWindowOptions.ProfilePath is not set.

ProfilePath

public string? ProfilePath { get; init; }

Gets the browser profile directory, created when missing.

Remarks

Chromium-based browsers and WebView2 use it as their user-data directory, and Firefox as its profile. The macOS and GTK 3 embedded windows ignore it. When neither this nor DesktopWindowOptions.ProfileName is set, a fresh temporary profile is generated for the presentation.

ProxyServer

public string? ProxyServer { get; init; }

Gets the proxy server passed to a Chromium-based browser, such as http://proxy:8080.

Remarks

Without it, Chromium-based browsers start with no proxy unless DesktopWindowOptions.BrowserArguments is set. Embedded windows use the system proxy, and Firefox ignores the option.

Resizable

public bool Resizable { get; init; }

Gets whether the user can resize the embedded window. Defaults to true.

Transparent

public bool Transparent { get; init; }

Gets whether the embedded window has a transparent background where the page does not paint.

Width

public uint Width { get; init; }

Gets the initial window width in pixels. Defaults to 800.

X

public uint? X { get; init; }

Gets the initial horizontal screen position in pixels, or null to let the platform choose.

Remarks

Applies only together with DesktopWindowOptions.Y; DesktopWindowOptions.Centered takes precedence. Firefox ignores it. When unset, the Windows WebView2 window opens at (100, 100). Windows scales DesktopWindowOptions.Width and DesktopWindowOptions.Height for the monitor DPI, but not the position.

Y

public uint? Y { get; init; }

Gets the initial vertical screen position in pixels, or null to let the platform choose.

Remarks

Applies only together with DesktopWindowOptions.X; DesktopWindowOptions.Centered takes precedence. Firefox ignores it. When unset, the Windows WebView2 window opens at (100, 100). Windows scales DesktopWindowOptions.Width and DesktopWindowOptions.Height for the monitor DPI, but not the position.