linux

package
v0.0.0-...-76cebe8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 27 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package linux implements the desktop platform layer on Linux with WebKitGTK, loaded at run time through purego (no cgo).

All GTK and WebKit calls happen on one OS thread: the thread that runs main, locked in init. New must be called from that goroutine.

Index

Constants

View Source
const Origin = "krate://app"

Origin is the app origin. Pages load from Origin + path.

Variables

View Source
var DialogHook func(p *DialogProbe) bool

DialogHook, when set, is called on the main thread with every new dialog before it is shown. If it returns true the dialog is not shown and the hook is expected to answer it (Cancel, Accept or Press), possibly later. Tests use it because a native dialog cannot be clicked headlessly.

View Source
var Logf = log.Printf

Logf receives diagnostics (blocked navigations, handler panics).

Functions

func ActivateMenuItem

func ActivateMenuItem(app any, id string) bool

ActivateMenuItem activates the first menu item with this id on any window of a platform.App made by this package (as a click would). For tests; it reports false for other Apps or an unknown id.

func DragDivider

func DragDivider(app any, ref caps.WindowRef, path string, pos int) error

DragDivider moves a divider of the window with this platform reference the way a drag does (see Window.SetDividerPosition). app is a platform.App or *App. For tests.

func Probe

func Probe() probe.Info

Probe reports whether WebKitGTK 4.1 and a display are available, without opening a window. It loads the libraries into the process.

func RequestClose

func RequestClose(app any, ref caps.WindowRef) bool

RequestClose delivers a window-manager style close request to a window (by platform reference) as the title bar button would. It reports whether the window was found. For tests.

func XEmbedTrayEmbedded

func XEmbedTrayEmbedded(app any) bool

XEmbedTrayEmbedded reports whether the status icon of a platform.App made by this package is currently docked in a tray. For tests.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the WebKitGTK application.

func New

func New(opts Options) (*App, error)

New initializes GTK and WebKit. It must run on the main goroutine.

func (*App) ActivateMenuItem

func (a *App) ActivateMenuItem(ref caps.WindowRef, id string) bool

ActivateMenuItem activates the first menu bar item with this id on window ref (0 means any), as a click would. For tests.

func (*App) AutomationEndpoint

func (a *App) AutomationEndpoint() caps.Endpoint

AutomationEndpoint reports the remote inspector endpoint, if any.

func (*App) CancelDownload

func (a *App) CancelDownload(id uint64) (err error)

CancelDownload cancels a running download.

func (*App) Clear

func (a *App) Clear() error

Clear empties the clipboard.

func (*App) ClearPartition

func (a *App) ClearPartition(partition string, o caps.ClearSiteDataOptions) error

ClearPartition removes stored data of a partition.

func (*App) ClearSiteData

func (a *App) ClearSiteData(o caps.ClearSiteDataOptions) error

ClearSiteData removes cookies, caches and storage.

func (*App) ClipboardFormats

func (a *App) ClipboardFormats() (out []string, err error)

ClipboardFormats lists the targets on the clipboard, with the text targets folded into text/plain.

func (*App) ContextCommand

func (a *App) ContextCommand(window caps.WindowRef, cmd, arg string) error

ContextCommand runs a built-in command on the view that last showed a context menu in the window.

func (*App) Cookies

func (a *App) Cookies(origin string) ([]caps.Cookie, error)

Cookies lists the cookies of an origin.

func (*App) DeleteCookie

func (a *App) DeleteCookie(origin string, c caps.Cookie) error

DeleteCookie removes the cookies of the origin with this name (and path and domain when c names them). The jar matches a deletion on the cookie's value too, so the cookies are looked up first.

func (*App) Dispatch

func (a *App) Dispatch(fn func())

Dispatch queues fn to run on the main thread. One idle source drains the whole queue, so the number of C callbacks stays fixed.

func (*App) Displays

func (a *App) Displays() (out []caps.Display, err error)

Displays lists the GDK monitors, primary first.

func (*App) FileDialog

func (a *App) FileDialog(parent caps.WindowRef, o caps.FileDialogOptions) ([]string, error)

FileDialog shows a GtkFileChooserNative and blocks until it is answered.

func (*App) IsRemoteView

func (a *App) IsRemoteView(ref caps.ViewRef) bool

IsRemoteView reports whether a view shows remote content.

func (*App) MessageDialog

func (a *App) MessageDialog(parent caps.WindowRef, o caps.MessageDialogOptions) (int, error)

MessageDialog shows a GtkMessageDialog and blocks until it is answered.

func (*App) NavigateRemote

func (a *App) NavigateRemote(ref caps.ViewRef, raw string) (err error)

NavigateRemote loads a URL in the view if the view's policy allows it.

func (*App) NewRemoteWindow

func (a *App) NewRemoteWindow(spec caps.RemoteWindowSpec) (caps.RemoteWindow, error)

NewRemoteWindow opens a window whose primary view shows remote content.

func (*App) NewWindow

func (a *App) NewWindow(opts WindowOptions) (*Window, error)

NewWindow opens a window on the app origin.

func (*App) NewWindowNotify

func (a *App) NewWindowNotify(opts WindowOptions, onLoad func()) (*Window, error)

NewWindowNotify opens a window and installs onLoad (see OnLoadFinished) before the first page can finish loading.

func (*App) OffscreenSupported

func (a *App) OffscreenSupported() bool

OffscreenSupported reports whether NewWindow honors Offscreen.

func (*App) OnAllClosed

func (a *App) OnAllClosed(fn func())

OnAllClosed sets what happens when the last window closes. The default (nil) quits the application.

func (*App) OnContextMenu

func (a *App) OnContextMenu(fn func(caps.ContextMenuInfo))

OnContextMenu sets the handler for right clicks in custom views.

func (*App) OnDisplays

func (a *App) OnDisplays(fn func())

OnDisplays sets the handler for monitor changes. fn runs on the main thread.

func (*App) OnDownload

func (a *App) OnDownload(fn func(caps.DownloadEvent))

OnDownload sets the handler for download events.

func (*App) OnDownloadStart

func (a *App) OnDownloadStart(fn func(r caps.DownloadRequest, decide func(path string)))

OnDownloadStart sets the handler that chooses download destinations.

func (*App) OnFileDrop

func (a *App) OnFileDrop(fn func(caps.FileDrop))

OnFileDrop sets the handler for files dropped onto a view. The page keeps its own HTML5 drop events: the handlers below only watch the GTK drag signals and never stop them.

func (*App) OnFind

func (a *App) OnFind(fn func(caps.FindEvent))

OnFind sets the handler for find results.

func (*App) OnMenu

func (a *App) OnMenu(fn func(caps.MenuEvent))

OnMenu sets the handler for menu clicks.

func (*App) OnRemoteEvent

func (a *App) OnRemoteEvent(fn func(caps.RemoteEvent))

OnRemoteEvent sets the handler for remote events.

func (*App) OnShortcut

func (a *App) OnShortcut(fn func(handle string))

OnShortcut sets the handler for global shortcut presses.

func (*App) OnViewCrash

func (a *App) OnViewCrash(fn func(caps.ViewCrash))

OnViewCrash sets the handler for web process crashes.

func (*App) OnViewEvent

func (a *App) OnViewEvent(fn func(caps.ViewEvent))

OnViewEvent sets the handler for view events.

func (*App) OnWindowEvent

func (a *App) OnWindowEvent(fn func(caps.WindowEvent))

OnWindowEvent sets the handler for window events.

func (*App) OnXEmbedTray

func (a *App) OnXEmbedTray(fn func(caps.TrayEvent))

OnXEmbedTray sets the handler for tray events.

func (*App) OpenInspector

func (a *App) OpenInspector(ref caps.ViewRef) (err error)

OpenInspector shows the WebKit inspector of a view.

func (*App) Origin

func (a *App) Origin() string

Origin returns "krate://app".

func (*App) PopupMenu

func (a *App) PopupMenu(parent caps.WindowRef, items []caps.MenuItem, px, py int) error

PopupMenu shows a context menu. Negative x or y means the pointer.

func (*App) PostToRemote

func (a *App) PostToRemote(ref caps.ViewRef, target string, data []byte) (err error)

PostToRemote delivers a message to the page of a remote view.

func (*App) Quit

func (a *App) Quit()

Quit stops the main loop.

func (*App) ReadFiles

func (a *App) ReadFiles() (paths []string, err error)

ReadFiles returns the file paths on the clipboard.

func (*App) ReadFormat

func (a *App) ReadFormat(name string) ([]byte, error)

ReadFormat returns one format's bytes.

func (*App) ReadHTML

func (a *App) ReadHTML() (string, error)

ReadHTML returns the HTML on the clipboard.

func (*App) ReadImage

func (a *App) ReadImage() (png []byte, err error)

ReadImage returns the clipboard image as PNG bytes.

func (*App) ReadRTF

func (a *App) ReadRTF() (string, error)

ReadRTF returns the RTF on the clipboard.

func (*App) ReadText

func (a *App) ReadText() (s string, err error)

ReadText returns the clipboard text.

func (*App) RegisterShortcut

func (a *App) RegisterShortcut(handle string, acc caps.Accelerator) error

RegisterShortcut grabs the key combination system-wide on X11. Under Wayland (or when libX11 is missing) it returns krate.ErrUnsupported; the SDK then tries the GlobalShortcuts portal.

func (*App) ReloadView

func (a *App) ReloadView(ref caps.ViewRef) error

ReloadView loads the view's current route again. After a crash the view shows nothing; loading starts a new web process.

func (*App) RemoteCapabilities

func (a *App) RemoteCapabilities() caps.RemoteCaps

RemoteCapabilities reports what this WebKitGTK can do. Subresource redirects and request headers are not possible: WebKitGTK offers no hook that can change a subresource request without a web process extension.

func (*App) RemoteOrigin

func (a *App) RemoteOrigin(ref caps.ViewRef) (origin string)

RemoteOrigin is the origin of the page the view shows now.

func (*App) Run

func (a *App) Run(onReady func()) error

Run runs the GTK main loop until Quit. onReady runs on the main thread once the loop is running.

func (*App) SetAppMenu

func (a *App) SetAppMenu(items []caps.MenuItem) error

SetAppMenu installs the menu bar on every window, now and for windows opened later.

func (*App) SetAuthHandler

func (a *App) SetAuthHandler(fn func(caps.AuthRequest, func(string, string, bool)))

SetAuthHandler sets the handler for HTTP authentication challenges.

func (*App) SetCertificateHandler

func (a *App) SetCertificateHandler(fn func(caps.CertError, func(bool)))

SetCertificateHandler sets the handler for refused certificates.

func (*App) SetClientCertificate

func (a *App) SetClientCertificate(partition, host, certFile, keyFile string) (err error)

SetClientCertificate makes the partition answer a client certificate request of host with the PEM files.

func (*App) SetContextMenu

func (a *App) SetContextMenu(window caps.WindowRef, view caps.ViewRef, p caps.ContextMenuPolicy) error

SetContextMenu sets the policy of a view, a window or the whole app.

func (*App) SetCookie

func (a *App) SetCookie(origin string, c caps.Cookie) error

SetCookie stores a cookie.

func (*App) SetPermissionHandler

func (a *App) SetPermissionHandler(h caps.PermissionHandler)

SetPermissionHandler routes the webview's camera, microphone, screen capture, location, notification and clipboard-read requests to h. Without a handler they are denied. Request types the engine always decided itself (pointer lock, website data access) are not affected.

func (*App) SetProxy

func (a *App) SetProxy(partition string, c caps.ProxyConfig) error

SetProxy sets the proxy of a partition.

func (*App) SetRequestRules

func (a *App) SetRequestRules(partition string, rules []caps.RequestRule) error

SetRequestRules replaces the request rules of a partition. Block rules become a content blocker (every request of the partition's views); redirect and header rules act on navigations.

func (*App) SetUserAgent

func (a *App) SetUserAgent(partition, ua string) (err error)

SetUserAgent sets the user agent of a partition.

func (*App) SetWindowTheme

func (a *App) SetWindowTheme(mode string) error

SetWindowTheme selects the GTK light or dark variant for every window. GTK 3 draws its own title bars, so this changes them too.

func (*App) SetXEmbedTray

func (a *App) SetXEmbedTray(ic *caps.TrayIcon) error

SetXEmbedTray shows, updates or removes the XEmbed tray icon.

func (*App) SnapshotView

func (a *App) SnapshotView(ref caps.ViewRef, o caps.SnapshotOptions) (caps.Snapshot, error)

SnapshotView renders a view to BGRA pixels. It blocks until WebKit delivers the frame (up to ten seconds) and may be called from any goroutine.

func (*App) StopShortcuts

func (a *App) StopShortcuts()

StopShortcuts releases every grab and ends the event loop.

func (*App) UnregisterShortcut

func (a *App) UnregisterShortcut(handle string) error

UnregisterShortcut releases a grab.

func (*App) ViewCount

func (a *App) ViewCount() (n int)

ViewCount returns the number of windows that hold a webview, for tests.

func (*App) WebKitVersion

func (a *App) WebKitVersion() string

WebKitVersion returns the loaded WebKitGTK version, e.g. "2.54.0".

func (*App) WebViewCount

func (a *App) WebViewCount() (n int)

WebViewCount returns the number of live webviews of the app, for tests.

func (*App) WebviewProcesses

func (a *App) WebviewProcesses() ([]caps.ProcessRef, []string)

WebviewProcesses lists the WebKit helper processes (WebKitWebProcess, WebKitNetworkProcess, WebKitGPUProcess) among the descendants of this process, classified by executable name.

func (*App) WindowByRef

func (a *App) WindowByRef(r caps.WindowRef) *Window

WindowByRef returns the window for a Ref, or nil.

func (*App) WindowOfView

func (a *App) WindowOfView(ref caps.ViewRef) (caps.WindowRef, bool)

WindowOfView says which window owns a view. It may be called from any goroutine.

func (*App) WriteFiles

func (a *App) WriteFiles(paths []string) error

WriteFiles puts a file list on the clipboard (text/uri-list and the GNOME copied-files format).

func (*App) WriteFormat

func (a *App) WriteFormat(name string, data []byte) error

WriteFormat replaces the clipboard with one format.

func (*App) WriteImage

func (a *App) WriteImage(png []byte) error

WriteImage puts a PNG image on the clipboard.

func (*App) WriteRich

func (a *App) WriteRich(d caps.ClipboardData) error

WriteRich puts text, HTML and RTF on the clipboard together.

func (*App) WriteText

func (a *App) WriteText(s string) error

WriteText replaces the clipboard with text.

func (*App) XEmbedTrayAvailable

func (a *App) XEmbedTrayAvailable() bool

XEmbedTrayAvailable reports whether a tray manager owns _NET_SYSTEM_TRAY_S<screen> on the default X screen.

type DialogProbe

type DialogProbe struct {

	// Kind is "file" or "message".
	Kind string
	// contains filtered or unexported fields
}

DialogProbe lets a test inspect a dialog that was just created and answer it without a user. See App.DialogHook.

func (*DialogProbe) Accept

func (p *DialogProbe) Accept(names ...string)

Accept selects name (file dialogs) and answers as if the user pressed OK.

func (*DialogProbe) Action

func (p *DialogProbe) Action() int

Action returns the GtkFileChooserAction (0 open, 1 save, 2 select folder).

func (*DialogProbe) Cancel

func (p *DialogProbe) Cancel()

Cancel answers the dialog as if the user pressed Cancel.

func (*DialogProbe) FilterNames

func (p *DialogProbe) FilterNames() []string

FilterNames lists the filter names in order.

func (*DialogProbe) Multiple

func (p *DialogProbe) Multiple() bool

Multiple reports whether several files may be chosen.

func (*DialogProbe) Press

func (p *DialogProbe) Press(index int)

Press answers a message dialog as if the button with this response id (the button index) was pressed.

func (*DialogProbe) Show

func (p *DialogProbe) Show()

Show maps the dialog so that a file chooser loads its folder; Accept with a file name needs that.

func (*DialogProbe) Title

func (p *DialogProbe) Title() string

Title returns the dialog title.

type Features

type Features struct {
	Media, WebAudio, WebGL, WebRTC, SpellCheck bool
}

Features says which optional engine features the app uses. The memory profiles other than "performance" switch the unused ones off.

type Memory

type Memory struct {
	// Profile is "balanced", "minimal" or "performance". Empty means
	// "performance": none of the levers below run.
	Profile  string
	Features Features
}

Memory is the webview memory profile (see package internal/memory).

type MissingLibError

type MissingLibError struct {
	Lib     string
	Package string
	Err     error
}

MissingLibError reports shared libraries that could not be loaded.

func (*MissingLibError) Error

func (e *MissingLibError) Error() string

func (*MissingLibError) Unwrap

func (e *MissingLibError) Unwrap() error

type Options

type Options struct {
	AppID string
	// Icon is the app icon as PNG bytes, set as the default icon of every
	// window. nil keeps the theme's default.
	Icon    []byte
	Handler http.Handler
	Debug   bool
	// Memory selects the memory profile; the zero value keeps the engine
	// defaults.
	Memory Memory
	// KeepAlive keeps the app running when its last window closes: that
	// window is released (hidden, webview destroyed) and Show brings it back.
	KeepAlive bool
	// Remote starts the WebKit remote inspector server (see automation.go).
	Remote caps.RemoteDebug
}

Options configures the application.

type Window

type Window struct {
	// contains filtered or unexported fields
}

Window is one top-level window with one webview, or several laid out as split panes (see views.go).

func (*Window) AddRemoteView

func (w *Window) AddRemoteView(o caps.ViewOptions, r caps.RemoteOptions) (ref caps.ViewRef, err error)

AddRemoteView adds a remote view to the window.

func (*Window) AddView

func (w *Window) AddView(o caps.ViewOptions) (ref caps.ViewRef, err error)

AddView creates a view on o.Path and splits it into the layout.

func (*Window) Capture

func (w *Window) Capture(ref caps.ViewRef, _ caps.CaptureOptions) ([]byte, error)

Capture takes a PNG of the visible area of a view.

func (*Window) ChromeState

func (w *Window) ChromeState() (st caps.ChromeState)

ChromeState reports the window's chrome.

func (*Window) Close

func (w *Window) Close()

Close destroys the window. With KeepAlive the last live window is released instead (hidden, webview destroyed) and Show brings it back.

func (*Window) Eval

func (w *Window) Eval(js string)

Eval runs JavaScript in the page without waiting for a result.

func (*Window) EvalView

func (w *Window) EvalView(ref caps.ViewRef, js string) (err error)

EvalView runs JavaScript in a view without waiting for the result.

func (*Window) Find

func (w *Window) Find(ref caps.ViewRef, text string, o caps.FindOptions) (err error)

Find searches for text in a view.

func (*Window) Focus

func (w *Window) Focus()

Focus raises and focuses the window.

func (*Window) FocusView

func (w *Window) FocusView(ref caps.ViewRef) (err error)

FocusView gives keyboard focus to a view.

func (*Window) GDKState

func (w *Window) GDKState() (f uint32)

GDKState returns the raw GdkWindowState bits (0 if unmapped); for tests.

func (*Window) Hide

func (w *Window) Hide()

Hide hides the window without destroying it. The page gets a krate:memory-pressure event and the shell returns free memory to the system. Use Release to also free the webview.

func (*Window) Layout

func (w *Window) Layout() (out *caps.LayoutNode)

Layout returns the layout with the ratios the dividers have now.

func (*Window) Maximize

func (w *Window) Maximize()

Maximize maximizes the window.

func (*Window) Minimize

func (w *Window) Minimize()

Minimize iconifies the window.

func (*Window) Navigate

func (w *Window) Navigate(path string)

Navigate loads path on the app origin.

func (*Window) NavigateView

func (w *Window) NavigateView(ref caps.ViewRef, path string) (err error)

NavigateView loads a route in a view.

func (*Window) OnLoadFinished

func (w *Window) OnLoadFinished(fn func())

OnLoadFinished sets a hook that runs on the main thread each time a page finishes loading.

func (*Window) PrimaryView

func (w *Window) PrimaryView() caps.ViewRef

PrimaryView is the view the window was created with.

func (*Window) PrintDialog

func (w *Window) PrintDialog(ref caps.ViewRef) (err error)

PrintDialog opens the print dialog of a view. It returns once the dialog is requested; the dialog runs on the main loop.

func (*Window) PrintPDF

func (w *Window) PrintPDF(ref caps.ViewRef, o caps.PDFOptions) ([]byte, error)

PrintPDF renders a view to a PDF.

func (*Window) Ref

func (w *Window) Ref() caps.WindowRef

Ref identifies the window to the capability interfaces.

func (*Window) Release

func (w *Window) Release()

Release saves the route and scroll position of every view of the window, hides the window and destroys all its webviews. Show or Focus recreates them on the routes and layout they had.

func (*Window) Released

func (w *Window) Released() (r bool)

Released reports whether the window holds no webview.

func (*Window) RemoveView

func (w *Window) RemoveView(ref caps.ViewRef) (err error)

RemoveView destroys a view of the window; the sibling takes its space.

func (*Window) Restore

func (w *Window) Restore()

Restore undoes minimize, maximize and fullscreen.

func (*Window) SetAlwaysOnTop

func (w *Window) SetAlwaysOnTop(on bool)

SetAlwaysOnTop keeps the window above others. Wayland compositors ignore the request for ordinary toplevels; X11 window managers honor it.

func (*Window) SetBackdrop

func (w *Window) SetBackdrop(name string) error

SetBackdrop is a Windows feature.

func (*Window) SetDecorated

func (w *Window) SetDecorated(on bool)

SetDecorated(false) makes the window frameless.

func (*Window) SetDividerPosition

func (w *Window) SetDividerPosition(path string, pos int) (err error)

SetDividerPosition moves the divider of the split at path (see caps.Divider.Path) to pos pixels from the start of its pane, the way a drag of the divider handle does: it goes through gtk_paned_set_position. It is for tests, which cannot move the pointer.

func (*Window) SetFullscreen

func (w *Window) SetFullscreen(on bool)

SetFullscreen enters or leaves fullscreen.

func (*Window) SetLayout

func (w *Window) SetLayout(root *caps.LayoutNode) (err error)

SetLayout replaces the layout of the window.

func (*Window) SetPosition

func (w *Window) SetPosition(px, py int)

SetPosition moves the window. Wayland ignores it.

func (*Window) SetPreventClose

func (w *Window) SetPreventClose(on bool)

SetPreventClose turns close requests into WindowCloseRequested events.

func (*Window) SetSize

func (w *Window) SetSize(width, height int)

SetSize resizes the window.

func (*Window) SetTitle

func (w *Window) SetTitle(title string)

SetTitle sets the window title.

func (*Window) SetTitleBar

func (w *Window) SetTitleBar(style string) error

SetTitleBar switches between the window manager's title bar and none.

func (*Window) SetTitleBarOverlay

func (w *Window) SetTitleBarOverlay(o *caps.TitleBarOverlay) error

SetTitleBarOverlay is a Windows feature.

func (*Window) SetTrafficLightPosition

func (w *Window) SetTrafficLightPosition(p caps.Point) error

SetTrafficLightPosition is a macOS feature.

func (*Window) SetVibrancy

func (w *Window) SetVibrancy(material string) error

SetVibrancy is a macOS feature.

func (*Window) SetZoomFactor

func (w *Window) SetZoomFactor(ref caps.ViewRef, f float64) (err error)

SetZoomFactor sets the zoom of a view.

func (*Window) Show

func (w *Window) Show()

Show makes the window visible. A released window gets its webview back on the route and scroll position it had.

func (*Window) Size

func (w *Window) Size() (width, height int)

Size returns the current window size.

func (*Window) StartDrag

func (w *Window) StartDrag() error

StartDrag starts a window-manager move from the press that is happening.

func (*Window) StartResize

func (w *Window) StartResize(edge string) error

StartResize starts a window-manager resize from an edge.

func (*Window) State

func (w *Window) State() (st caps.WindowState)

State reads the window state. Maximized, minimized, fullscreen and focus come from the GDK window state, which a window manager sets; AlwaysOnTop reports the GDK flag or, when no window manager acknowledged it, the request.

func (*Window) StopFind

func (w *Window) StopFind(ref caps.ViewRef) (err error)

StopFind clears the highlight.

func (*Window) Title

func (w *Window) Title() string

Title returns the current window title.

func (*Window) ToggleMaximize

func (w *Window) ToggleMaximize() error

ToggleMaximize maximizes the window or restores it.

func (*Window) Views

func (w *Window) Views() (out []caps.ViewInfo)

Views lists the views of the window.

func (*Window) ZoomFactor

func (w *Window) ZoomFactor(ref caps.ViewRef) (z float64, err error)

ZoomFactor returns the zoom of a view.

type WindowOptions

type WindowOptions struct {
	Title     string
	Width     int
	Height    int
	Resizable bool
	Path      string
	// Chrome is the window chrome the window starts with.
	Chrome caps.ChromeOptions
	// Offscreen opens a window that is never mapped on screen (a
	// GtkOffscreenWindow) whose page still renders; see SnapshotView.
	Offscreen bool
}

WindowOptions configures one window.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL