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
- Variables
- func ActivateMenuItem(app any, id string) bool
- func DragDivider(app any, ref caps.WindowRef, path string, pos int) error
- func Probe() probe.Info
- func RequestClose(app any, ref caps.WindowRef) bool
- func XEmbedTrayEmbedded(app any) bool
- type App
- func (a *App) ActivateMenuItem(ref caps.WindowRef, id string) bool
- func (a *App) AutomationEndpoint() caps.Endpoint
- func (a *App) CancelDownload(id uint64) (err error)
- func (a *App) Clear() error
- func (a *App) ClearPartition(partition string, o caps.ClearSiteDataOptions) error
- func (a *App) ClearSiteData(o caps.ClearSiteDataOptions) error
- func (a *App) ClipboardFormats() (out []string, err error)
- func (a *App) ContextCommand(window caps.WindowRef, cmd, arg string) error
- func (a *App) Cookies(origin string) ([]caps.Cookie, error)
- func (a *App) DeleteCookie(origin string, c caps.Cookie) error
- func (a *App) Dispatch(fn func())
- func (a *App) Displays() (out []caps.Display, err error)
- func (a *App) FileDialog(parent caps.WindowRef, o caps.FileDialogOptions) ([]string, error)
- func (a *App) IsRemoteView(ref caps.ViewRef) bool
- func (a *App) MessageDialog(parent caps.WindowRef, o caps.MessageDialogOptions) (int, error)
- func (a *App) NavigateRemote(ref caps.ViewRef, raw string) (err error)
- func (a *App) NewRemoteWindow(spec caps.RemoteWindowSpec) (caps.RemoteWindow, error)
- func (a *App) NewWindow(opts WindowOptions) (*Window, error)
- func (a *App) NewWindowNotify(opts WindowOptions, onLoad func()) (*Window, error)
- func (a *App) OffscreenSupported() bool
- func (a *App) OnAllClosed(fn func())
- func (a *App) OnContextMenu(fn func(caps.ContextMenuInfo))
- func (a *App) OnDisplays(fn func())
- func (a *App) OnDownload(fn func(caps.DownloadEvent))
- func (a *App) OnDownloadStart(fn func(r caps.DownloadRequest, decide func(path string)))
- func (a *App) OnFileDrop(fn func(caps.FileDrop))
- func (a *App) OnFind(fn func(caps.FindEvent))
- func (a *App) OnMenu(fn func(caps.MenuEvent))
- func (a *App) OnRemoteEvent(fn func(caps.RemoteEvent))
- func (a *App) OnShortcut(fn func(handle string))
- func (a *App) OnViewCrash(fn func(caps.ViewCrash))
- func (a *App) OnViewEvent(fn func(caps.ViewEvent))
- func (a *App) OnWindowEvent(fn func(caps.WindowEvent))
- func (a *App) OnXEmbedTray(fn func(caps.TrayEvent))
- func (a *App) OpenInspector(ref caps.ViewRef) (err error)
- func (a *App) Origin() string
- func (a *App) PopupMenu(parent caps.WindowRef, items []caps.MenuItem, px, py int) error
- func (a *App) PostToRemote(ref caps.ViewRef, target string, data []byte) (err error)
- func (a *App) Quit()
- func (a *App) ReadFiles() (paths []string, err error)
- func (a *App) ReadFormat(name string) ([]byte, error)
- func (a *App) ReadHTML() (string, error)
- func (a *App) ReadImage() (png []byte, err error)
- func (a *App) ReadRTF() (string, error)
- func (a *App) ReadText() (s string, err error)
- func (a *App) RegisterShortcut(handle string, acc caps.Accelerator) error
- func (a *App) ReloadView(ref caps.ViewRef) error
- func (a *App) RemoteCapabilities() caps.RemoteCaps
- func (a *App) RemoteOrigin(ref caps.ViewRef) (origin string)
- func (a *App) Run(onReady func()) error
- func (a *App) SetAppMenu(items []caps.MenuItem) error
- func (a *App) SetAuthHandler(fn func(caps.AuthRequest, func(string, string, bool)))
- func (a *App) SetCertificateHandler(fn func(caps.CertError, func(bool)))
- func (a *App) SetClientCertificate(partition, host, certFile, keyFile string) (err error)
- func (a *App) SetContextMenu(window caps.WindowRef, view caps.ViewRef, p caps.ContextMenuPolicy) error
- func (a *App) SetCookie(origin string, c caps.Cookie) error
- func (a *App) SetPermissionHandler(h caps.PermissionHandler)
- func (a *App) SetProxy(partition string, c caps.ProxyConfig) error
- func (a *App) SetRequestRules(partition string, rules []caps.RequestRule) error
- func (a *App) SetUserAgent(partition, ua string) (err error)
- func (a *App) SetWindowTheme(mode string) error
- func (a *App) SetXEmbedTray(ic *caps.TrayIcon) error
- func (a *App) SnapshotView(ref caps.ViewRef, o caps.SnapshotOptions) (caps.Snapshot, error)
- func (a *App) StopShortcuts()
- func (a *App) UnregisterShortcut(handle string) error
- func (a *App) ViewCount() (n int)
- func (a *App) WebKitVersion() string
- func (a *App) WebViewCount() (n int)
- func (a *App) WebviewProcesses() ([]caps.ProcessRef, []string)
- func (a *App) WindowByRef(r caps.WindowRef) *Window
- func (a *App) WindowOfView(ref caps.ViewRef) (caps.WindowRef, bool)
- func (a *App) WriteFiles(paths []string) error
- func (a *App) WriteFormat(name string, data []byte) error
- func (a *App) WriteImage(png []byte) error
- func (a *App) WriteRich(d caps.ClipboardData) error
- func (a *App) WriteText(s string) error
- func (a *App) XEmbedTrayAvailable() bool
- type DialogProbe
- type Features
- type Memory
- type MissingLibError
- type Options
- type Window
- func (w *Window) AddRemoteView(o caps.ViewOptions, r caps.RemoteOptions) (ref caps.ViewRef, err error)
- func (w *Window) AddView(o caps.ViewOptions) (ref caps.ViewRef, err error)
- func (w *Window) Capture(ref caps.ViewRef, _ caps.CaptureOptions) ([]byte, error)
- func (w *Window) ChromeState() (st caps.ChromeState)
- func (w *Window) Close()
- func (w *Window) Eval(js string)
- func (w *Window) EvalView(ref caps.ViewRef, js string) (err error)
- func (w *Window) Find(ref caps.ViewRef, text string, o caps.FindOptions) (err error)
- func (w *Window) Focus()
- func (w *Window) FocusView(ref caps.ViewRef) (err error)
- func (w *Window) GDKState() (f uint32)
- func (w *Window) Hide()
- func (w *Window) Layout() (out *caps.LayoutNode)
- func (w *Window) Maximize()
- func (w *Window) Minimize()
- func (w *Window) Navigate(path string)
- func (w *Window) NavigateView(ref caps.ViewRef, path string) (err error)
- func (w *Window) OnLoadFinished(fn func())
- func (w *Window) PrimaryView() caps.ViewRef
- func (w *Window) PrintDialog(ref caps.ViewRef) (err error)
- func (w *Window) PrintPDF(ref caps.ViewRef, o caps.PDFOptions) ([]byte, error)
- func (w *Window) Ref() caps.WindowRef
- func (w *Window) Release()
- func (w *Window) Released() (r bool)
- func (w *Window) RemoveView(ref caps.ViewRef) (err error)
- func (w *Window) Restore()
- func (w *Window) SetAlwaysOnTop(on bool)
- func (w *Window) SetBackdrop(name string) error
- func (w *Window) SetDecorated(on bool)
- func (w *Window) SetDividerPosition(path string, pos int) (err error)
- func (w *Window) SetFullscreen(on bool)
- func (w *Window) SetLayout(root *caps.LayoutNode) (err error)
- func (w *Window) SetPosition(px, py int)
- func (w *Window) SetPreventClose(on bool)
- func (w *Window) SetSize(width, height int)
- func (w *Window) SetTitle(title string)
- func (w *Window) SetTitleBar(style string) error
- func (w *Window) SetTitleBarOverlay(o *caps.TitleBarOverlay) error
- func (w *Window) SetTrafficLightPosition(p caps.Point) error
- func (w *Window) SetVibrancy(material string) error
- func (w *Window) SetZoomFactor(ref caps.ViewRef, f float64) (err error)
- func (w *Window) Show()
- func (w *Window) Size() (width, height int)
- func (w *Window) StartDrag() error
- func (w *Window) StartResize(edge string) error
- func (w *Window) State() (st caps.WindowState)
- func (w *Window) StopFind(ref caps.ViewRef) (err error)
- func (w *Window) Title() string
- func (w *Window) ToggleMaximize() error
- func (w *Window) Views() (out []caps.ViewInfo)
- func (w *Window) ZoomFactor(ref caps.ViewRef) (z float64, err error)
- type WindowOptions
Constants ¶
const Origin = "krate://app"
Origin is the app origin. Pages load from Origin + path.
Variables ¶
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.
var Logf = log.Printf
Logf receives diagnostics (blocked navigations, handler panics).
Functions ¶
func ActivateMenuItem ¶
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 ¶
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 ¶
Probe reports whether WebKitGTK 4.1 and a display are available, without opening a window. It loads the libraries into the process.
func RequestClose ¶
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 ¶
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 (*App) ActivateMenuItem ¶
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 ¶
AutomationEndpoint reports the remote inspector endpoint, if any.
func (*App) CancelDownload ¶
CancelDownload cancels a running download.
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 ¶
ClipboardFormats lists the targets on the clipboard, with the text targets folded into text/plain.
func (*App) ContextCommand ¶
ContextCommand runs a built-in command on the view that last showed a context menu in the window.
func (*App) DeleteCookie ¶
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) FileDialog ¶
FileDialog shows a GtkFileChooserNative and blocks until it is answered.
func (*App) IsRemoteView ¶
IsRemoteView reports whether a view shows remote content.
func (*App) MessageDialog ¶
MessageDialog shows a GtkMessageDialog and blocks until it is answered.
func (*App) NavigateRemote ¶
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 ¶
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 ¶
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) OnRemoteEvent ¶
func (a *App) OnRemoteEvent(fn func(caps.RemoteEvent))
OnRemoteEvent sets the handler for remote events.
func (*App) OnShortcut ¶
OnShortcut sets the handler for global shortcut presses.
func (*App) OnViewCrash ¶
OnViewCrash sets the handler for web process crashes.
func (*App) OnViewEvent ¶
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 ¶
OnXEmbedTray sets the handler for tray events.
func (*App) OpenInspector ¶
OpenInspector shows the WebKit inspector of a view.
func (*App) PostToRemote ¶
PostToRemote delivers a message to the page of a remote view.
func (*App) ReadFormat ¶
ReadFormat returns one format's bytes.
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 ¶
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 ¶
RemoteOrigin is the origin of the page the view shows now.
func (*App) Run ¶
Run runs the GTK main loop until Quit. onReady runs on the main thread once the loop is running.
func (*App) SetAppMenu ¶
SetAppMenu installs the menu bar on every window, now and for windows opened later.
func (*App) SetAuthHandler ¶
SetAuthHandler sets the handler for HTTP authentication challenges.
func (*App) SetCertificateHandler ¶
SetCertificateHandler sets the handler for refused certificates.
func (*App) SetClientCertificate ¶
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) 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 ¶
SetUserAgent sets the user agent of a partition.
func (*App) SetWindowTheme ¶
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 ¶
SetXEmbedTray shows, updates or removes the XEmbed tray icon.
func (*App) SnapshotView ¶
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 ¶
UnregisterShortcut releases a grab.
func (*App) WebKitVersion ¶
WebKitVersion returns the loaded WebKitGTK version, e.g. "2.54.0".
func (*App) WebViewCount ¶
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 ¶
WindowByRef returns the window for a Ref, or nil.
func (*App) WindowOfView ¶
WindowOfView says which window owns a view. It may be called from any goroutine.
func (*App) WriteFiles ¶
WriteFiles puts a file list on the clipboard (text/uri-list and the GNOME copied-files format).
func (*App) WriteFormat ¶
WriteFormat replaces the clipboard with one format.
func (*App) WriteImage ¶
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) XEmbedTrayAvailable ¶
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.
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 ¶
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) 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) 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) NavigateView ¶
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 ¶
PrimaryView is the view the window was created with.
func (*Window) PrintDialog ¶
PrintDialog opens the print dialog of a view. It returns once the dialog is requested; the dialog runs on the main loop.
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) RemoveView ¶
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 ¶
SetAlwaysOnTop keeps the window above others. Wayland compositors ignore the request for ordinary toplevels; X11 window managers honor it.
func (*Window) SetBackdrop ¶
SetBackdrop is a Windows feature.
func (*Window) SetDecorated ¶
SetDecorated(false) makes the window frameless.
func (*Window) SetDividerPosition ¶
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 ¶
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 ¶
SetPosition moves the window. Wayland ignores it.
func (*Window) SetPreventClose ¶
SetPreventClose turns close requests into WindowCloseRequested events.
func (*Window) SetTitleBar ¶
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 ¶
SetTrafficLightPosition is a macOS feature.
func (*Window) SetVibrancy ¶
SetVibrancy is a macOS feature.
func (*Window) SetZoomFactor ¶
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) StartResize ¶
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) ToggleMaximize ¶
ToggleMaximize maximizes the window or restores it.
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.
Source Files
¶
- a11y.go
- app.go
- automation.go
- bridge.go
- chrome.go
- clipboard.go
- contextmenu.go
- dialogs.go
- downloads.go
- ext.go
- filedrop.go
- inspector.go
- lib.go
- memory.go
- menus.go
- page.go
- permission.go
- probe.go
- procinfo.go
- release.go
- remote.go
- scheme.go
- shortcuts_x11.go
- sitedata.go
- snapshot.go
- system.go
- trim.go
- views.go
- winctl.go
- window.go
- xembed.go