appwindow

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 5 Imported by: 0 modules, 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 appwindow opens Flockdeck's user interface in its own native window.

It used to do that by spawning an installed Chromium-based browser as a separate process in "--app" mode: a chromeless window with no tabs, address bar or bookmarks that reads as a native application window. The window that opened, though, was never really Flockdeck's own -- it was owned by chrome.exe or msedge.exe, whichever browser answered, and Windows keys its taskbar identity, icon and pinning behaviour to the process that owns a window. Pinning "Flockdeck" to the taskbar pinned Chrome.

This package now uses Wails (github.com/wailsapp/wails/v3) to embed the platform's own webview -- WebView2 on Windows, WebKit on macOS, WebKitGTK on Linux -- directly inside flockdeck.exe, so the window this opens is genuinely Flockdeck's own process. It is pointed at the same local HTTP server the rest of Flockdeck already runs (see server.WindowURL), rather than at assets Wails serves itself: the server is already the single source of truth for the interface, including for remote.flockdeck.ai sessions over the relay, and the window this opens is just one more client of it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDefault added in v0.3.3

func OpenDefault(target string) error

OpenDefault opens target in the user's default browser: the fallback used where Flockdeck's own window could not be opened at all -- no working webview on this machine, say -- so that something still shows the interface rather than nothing.

Types

type Config added in v0.3.26

type Config struct {
	// Name is the application's name, used as the window's title and in its
	// default about box.
	Name string
	// Description appears in the default about box.
	Description string
	// Icon is the application's icon as PNG bytes. It is what a window gets
	// as its own icon on Windows when the running binary's own resources
	// don't carry one at the specific resource ID Wails looks for first (see
	// webui.Icon), and what macOS and Linux use for the window/dock icon.
	Icon []byte
}

Config is the application-level configuration Wails needs once per process: its name and icon, which is what identifies the window to the taskbar, the alt-tab switcher, and window manager.

type Window

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

Window is Flockdeck's single native window. Only one may exist per process: Wails' application object is a process-wide singleton, which suits Flockdeck's own model of one window-owning process per window -- see attach, in main.go, for the second case (a launch that joins an instance already running opens its own window in its own process, exactly as this package's predecessor did by spawning a whole separate browser).

func Open

func Open(cfg Config, target string) (*Window, error)

Open creates Flockdeck's window, pointed at target, and arranges for it to be shown once Run is called. It does not itself block -- Run does that, running the native event loop -- so that a caller can finish its own start-up (recording the running instance, starting background watchers) before handing control to it.

Open, like Run, must be called from the same goroutine the program's main function runs on and never from inside a spawned goroutine: Wails locks the OS thread it is first used from (see runtime.LockOSThread in its pkg/application/init_desktop.go), and on Windows the native message loop can only be pumped from that same thread.

func (*Window) Close

func (w *Window) Close()

Close asks the window to close, which is what unblocks a concurrent call to Run. It is safe to call more than once, and safe to call after Run has already returned -- both happen in the ordinary shutdown path, where something else (a signal, the UI's own Quit command) can race the user closing the window by hand.

func (*Window) Run added in v0.3.26

func (w *Window) Run() error

Run starts the native event loop and blocks until the window closes -- whether the user closed it, or Close was called -- returning whatever error the platform layer reports. It must be called from the same goroutine Open was (see Open's doc).

Jump to

Keyboard shortcuts

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