windowmanager

package
v0.3.0-beta.35 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package windowmanager owns workspace-scoped window topology and semantic mutations.

Index

Constants

View Source
const (
	NewWindowFloating          NewWindowPolicy     = "floating"
	NewWindowInsert            NewWindowPolicy     = "beside_focus"
	NewWindowTab               NewWindowPolicy     = "tab"
	SmallViewportStack         SmallViewportPolicy = "stack"
	SmallViewportReject        SmallViewportPolicy = "reject"
	FocusClickDirectional      FocusPolicy         = "click_directional"
	FocusDirectional           FocusPolicy         = "directional"
	DragAwayWindow             DragAwayPolicy      = "window"
	DragAwayGroup              DragAwayPolicy      = "group"
	DesktopTransitionSlide     DesktopTransition   = "slide"
	DesktopTransitionCrossfade DesktopTransition   = "crossfade"
	DesktopTransitionInstant   DesktopTransition   = "instant"
)
View Source
const DefaultGlobalSummonChord = "meta+shift+Space"
View Source
const DefaultGlobalSummonCommandID = "palette.summon.global"
View Source
const LayoutResourceVersion uint32 = 1

LayoutResourceVersion is the schema version required for a declarative window_layout resource.

View Source
const LegacySnapshotVersion uint32 = 3

LegacySnapshotVersion is the last stored aggregate shape that marked the desktop zoom created with a purpose and owner instead of flagging the window.

View Source
const MaxWireRevision uint64 = 1<<53 - 1

MaxWireRevision is the largest revision exactly representable by JSON clients.

View Source
const PreviousSnapshotVersion uint32 = 4
View Source
const SnapshotVersion uint32 = 5
View Source
const (
	WindowLayoutResourceKind resources.ResourceKind = "window_layout"
)

Variables

View Source
var (
	ErrWorkspaceNotFound             = errors.New("window manager workspace not found")
	ErrSnapshotNotFound              = errors.New("window manager snapshot not found")
	ErrRevisionConflict              = errors.New("window manager revision conflict")
	ErrInvalidCommand                = errors.New("window manager invalid command")
	ErrInvalidTopology               = errors.New("window manager invalid topology")
	ErrDesktopNotFound               = errors.New("window manager desktop not found")
	ErrWindowNotFound                = errors.New("window manager window not found")
	ErrClientNotFound                = errors.New("window manager client not found")
	ErrClientUnauthorized            = errors.New("window manager client unauthorized")
	ErrClientDisconnected            = errors.New("window manager client disconnected")
	ErrClientCommandTimedOut         = errors.New("window manager client command timed out")
	ErrDestinationRequired           = errors.New("window manager destination required")
	ErrFinalDesktop                  = errors.New("window manager final desktop")
	ErrHistoryBoundary               = errors.New("window manager history boundary")
	ErrLayoutResourceNotFound        = errors.New("window manager layout resource not found")
	ErrSlowConsumer                  = errors.New("window manager slow consumer")
	ErrPresentationRevisionExhausted = errors.New("window manager presentation revision exhausted")
	ErrContextRevisionExhausted      = errors.New("window manager context revision exhausted")
	ErrTopologyRevisionExhausted     = errors.New("window manager topology revision exhausted")
	ErrClosed                        = errors.New("window manager closed")
	ErrNotStacked                    = errors.New("window manager window not stacked")
	ErrWindowPinned                  = errors.New("window manager window pinned")
)

Functions

func CanonicalGlobalShortcuts

func CanonicalGlobalShortcuts(
	source map[string]string,
	bindableIDs BindableIDs,
) (map[string]string, error)

CanonicalGlobalShortcuts validates intended bindings against one catalog snapshot.

func CanonicalShortcutChord

func CanonicalShortcutChord(chord string) (string, error)

CanonicalShortcutChord validates one manifest or config chord with the daemon grammar.

func CanonicalShortcutsV2

func CanonicalShortcutsV2(
	overrides map[string]ShortcutBinding,
	bindableIDs BindableIDs,
) (map[string]ShortcutBinding, error)

CanonicalShortcutsV2 validates overrides, expands range families, and rejects collisions against both other overrides and daemon-owned defaults.

func CanonicalStoredGlobalShortcuts

func CanonicalStoredGlobalShortcuts(source map[string]string) (map[string]string, error)

CanonicalStoredGlobalShortcuts validates syntax and collisions without a live catalog.

func CanonicalStoredShortcutsV2

func CanonicalStoredShortcutsV2(
	overrides map[string]ShortcutBinding,
) (map[string]ShortcutBinding, error)

CanonicalStoredShortcutsV2 validates grammar and stored collisions without a live catalog.

func CloneGlobalShortcutMap

func CloneGlobalShortcutMap(source map[string]string) map[string]string

CloneGlobalShortcutMap returns an ownership-safe copy of intended global bindings.

func CloneShortcutMap

func CloneShortcutMap(source map[string]ShortcutBinding) map[string]ShortcutBinding

CloneShortcutMap returns an ownership-safe copy of a shortcut map and its bindings.

func DefaultKeymap

func DefaultKeymap() map[string]ShortcutBinding

DefaultKeymap returns the daemon-owned v2 keymap.

func EffectiveKeymap

func EffectiveKeymap(
	overrides map[string]ShortcutBinding,
	bindableIDs BindableIDs,
) (map[string]ShortcutBinding, error)

EffectiveKeymap merges override-wins bindings into daemon defaults and validates the whole map.

func EffectiveStoredKeymap

func EffectiveStoredKeymap(
	overrides map[string]ShortcutBinding,
) (map[string]ShortcutBinding, error)

EffectiveStoredKeymap resolves a trusted stored map without catalog membership checks.

func NewLayoutResourceCodec

func NewLayoutResourceCodec(observers ...AppDeprecationObserver) (resources.KindCodec[LayoutResource], error)

NewLayoutResourceCodec constructs the strict declarative window-layout codec.

func RetiredApp

func RetiredApp(app string) (string, bool)

RetiredApp remains part of the lossless stored-snapshot migration.

func TolerantEffectiveKeymapWithExtensionDefaults

func TolerantEffectiveKeymapWithExtensionDefaults(
	overrides map[string]ShortcutBinding,
	bindableIDs BindableIDs,
	defaults []ExtensionDefaultShortcut,
) (map[string]ShortcutBinding, []ExtensionDefaultStatus, []ShortcutDiagnostic, error)

TolerantEffectiveKeymapWithExtensionDefaults applies the extension tier after core defaults and user overrides, preserving every dormant claim for settings.

func ValidateSnapshot

func ValidateSnapshot(snapshot Snapshot) error

ValidateSnapshot checks every committed aggregate invariant without repairing input.

Types

type Actor

type Actor struct {
	Kind string `json:"kind,omitempty"`
	ID   string `json:"id,omitempty"`
}

Actor records the initiator without affecting command semantics.

type AppDeprecationObserver

type AppDeprecationObserver func(ctx context.Context, app, replacement, source string)

type ArrangeLayoutCommand

type ArrangeLayoutCommand struct {
	DesktopID   DesktopID
	WindowIDs   []WindowID
	Arrangement Arrangement
	Frame       NormalizedRect
	GroupID     GroupID
	ResourceID  string
	// KeepFrames makes each named window stand for its whole tab frame: a deck
	// is arranged as one participant with its members, active tab and identity
	// kept, and later names inside an already-named frame are absorbed. Without
	// it every named window is its own participant.
	KeepFrames bool
}

func (ArrangeLayoutCommand) CommandID

func (ArrangeLayoutCommand) CommandID() CommandID

type Arrangement

type Arrangement string
const (
	ArrangementHorizontal Arrangement = "horizontal"
	ArrangementVertical   Arrangement = "vertical"
	ArrangementGrid       Arrangement = "grid"
	ArrangementStack      Arrangement = "stack"
	// ArrangementMainStack gives the first participant the main column and
	// splits the remaining participants vertically in the side column.
	ArrangementMainStack Arrangement = "main_stack"
)

type Axis

type Axis string
const (
	AxisHorizontal Axis = "horizontal"
	AxisVertical   Axis = "vertical"
)

type BalanceLayoutCommand

type BalanceLayoutCommand struct {
	GroupID *GroupID
	SplitID *NodeID
}

func (BalanceLayoutCommand) CommandID

func (BalanceLayoutCommand) CommandID() CommandID

type BindableIDs

type BindableIDs map[string]struct{}

BindableIDs is the command-catalog snapshot accepted by keymap mutations.

func DefaultBindableIDs

func DefaultBindableIDs() BindableIDs

DefaultBindableIDs returns the ids carried by the daemon's shipped keymap.

func NewBindableIDs

func NewBindableIDs(ids []string) BindableIDs

NewBindableIDs builds an ownership-safe command-id set.

type BindingsConfig

type BindingsConfig struct {
	TopCenter    string `json:"top_center"`
	BottomCenter string `json:"bottom_center"`
}

BindingsConfig maps special snap regions to window-manager actions.

type ChangeSet

type ChangeSet struct {
	DesktopIDs     []DesktopID `json:"desktop_ids,omitempty"`
	WindowIDs      []WindowID  `json:"window_ids,omitempty"`
	GroupIDs       []GroupID   `json:"group_ids,omitempty"`
	NodeIDs        []NodeID    `json:"node_ids,omitempty"`
	ClientIDs      []ClientID  `json:"client_ids,omitempty"`
	StackGrouped   []NodeID    `json:"stack_grouped,omitempty"`
	StackUngrouped []NodeID    `json:"stack_ungrouped,omitempty"`
}

ChangeSet names the entities affected by one command.

type ClientCommand

type ClientCommand struct {
	CommandID string          `json:"command_id"`
	Op        string          `json:"op"`
	Payload   json.RawMessage `json:"payload,omitempty"`
}

ClientCommand is one invocation the daemon dispatches to an attached client.

type ClientCommandConnection

type ClientCommandConnection interface {
	Commands() <-chan ClientCommand
	Done() <-chan struct{}
	Err() error
	Resolve(ClientCommandResponse) error
	Close() error
}

ClientCommandConnection is the live channel used to dispatch and resolve commands.

type ClientCommandResponse

type ClientCommandResponse struct {
	CommandID string                      `json:"command_id"`
	Status    ClientCommandResponseStatus `json:"status"`
	Result    json.RawMessage             `json:"result,omitempty"`
	Error     string                      `json:"error,omitempty"`
}

ClientCommandResponse is the client's ack, result, or error for one command.

type ClientCommandResponseStatus

type ClientCommandResponseStatus string

ClientCommandResponseStatus is the ack, result, or error stage of one command.

const (
	ClientCommandAcknowledged ClientCommandResponseStatus = "ack"
	ClientCommandCompleted    ClientCommandResponseStatus = "result"
	ClientCommandFailed       ClientCommandResponseStatus = "error"
)

type ClientContextInput

type ClientContextInput struct {
	ScopeGlobal         bool
	FocusedSessionState string
	WorkspaceTrusted    bool
	DestinationIntent   *RouteIntent
	GlobalShortcuts     []GlobalShortcutRegistration
}

ClientContextInput carries only client-owned volatile palette state.

type ClientContextUpdate

type ClientContextUpdate struct {
	WorkspaceID WorkspaceID
	ClientID    ClientID
	Context     ClientContextInput
}

ClientContextUpdate replaces one attached client's palette and global-shortcut context.

type ClientID

type ClientID string

type ClientKind

type ClientKind string
const (
	ClientKindShell   ClientKind = "shell"
	ClientKindBrowser ClientKind = "browser"
)

type ClientRegistration

type ClientRegistration struct {
	WorkspaceID     WorkspaceID
	ClientID        ClientID
	Kind            ClientKind
	ActiveDesktopID DesktopID
	Context         ClientContextInput
}

ClientRegistration requests a live client view.

type ClientUnregisteredObserver

type ClientUnregisteredObserver func(context.Context, WorkspaceID, ClientID) error

ClientUnregisteredObserver tears down transient state owned by a detached client.

type ClientView

type ClientView struct {
	WorkspaceID          WorkspaceID                  `json:"workspace_id"`
	ClientID             ClientID                     `json:"client_id"`
	Kind                 ClientKind                   `json:"kind"`
	PresentationRevision uint64                       `json:"presentation_revision"`
	ContextRevision      uint64                       `json:"context_revision"`
	ActiveDesktopID      DesktopID                    `json:"active_desktop_id"`
	FocusedWindowID      *WindowID                    `json:"focused_window_id,omitzero"`
	FocusOrder           []WindowID                   `json:"focus_order"`
	StackActive          map[NodeID]WindowID          `json:"stack_active"`
	PaletteContext       PaletteContext               `json:"palette_context"`
	GlobalShortcuts      []GlobalShortcutRegistration `json:"global_shortcuts"`
	ConnectedAt          time.Time                    `json:"connected_at"`
	AttachmentToken      string                       `json:"attachment_token,omitempty"`
}

ClientView is transient presentation state for one connected client.

type CloseScope

type CloseScope string
const (
	CloseScopeTab    CloseScope = ""
	CloseScopeGroup  CloseScope = "group"
	CloseScopeOthers CloseScope = "others"
	CloseScopeRight  CloseScope = "right"
)

type CloseWindowCommand

type CloseWindowCommand struct {
	WindowID WindowID   `json:"window_id"`
	Minimize bool       `json:"minimize,omitzero"`
	Scope    CloseScope `json:"scope,omitempty"`
}

CloseWindowCommand minimizes instead of deleting when Minimize is true.

func (CloseWindowCommand) CommandID

func (CloseWindowCommand) CommandID() CommandID

type ClosedEntry

type ClosedEntry struct {
	Windows   []Window       `json:"windows"`
	ActiveID  *WindowID      `json:"active_id,omitzero"`
	StackID   *NodeID        `json:"stack_id,omitzero"`
	DesktopID DesktopID      `json:"desktop_id"`
	Rect      NormalizedRect `json:"rect"`
	ClosedAt  time.Time      `json:"closed_at"`
}

ClosedEntry is one reopenable close operation, newest last in Snapshot.ClosedEntries.

type Command

type Command interface {
	CommandID() CommandID
}

Command is one typed semantic mutation payload.

type CommandID

type CommandID string
const (
	CommandDesktopCreate        CommandID = "desktop.create"
	CommandDesktopUpdate        CommandID = "desktop.update"
	CommandDesktopReorder       CommandID = "desktop.reorder"
	CommandDesktopSwitch        CommandID = "desktop.switch"
	CommandDesktopDelete        CommandID = "desktop.delete"
	CommandWindowOpen           CommandID = "window.open"
	CommandWindowNavigate       CommandID = "window.navigate"
	CommandWindowClose          CommandID = "window.close"
	CommandWindowFocus          CommandID = "window.focus"
	CommandWindowMove           CommandID = "window.move"
	CommandWindowResize         CommandID = "window.resize"
	CommandWindowSwap           CommandID = "window.swap"
	CommandWindowToggleFloating CommandID = "window.toggle_floating"
	CommandWindowZoom           CommandID = "window.zoom"
	CommandWindowStackGroup     CommandID = "window.stack.group"
	CommandWindowStackReorder   CommandID = "window.stack.reorder"
	CommandWindowStackSetActive CommandID = "window.stack.set_active"
	CommandWindowPin            CommandID = "window.pin"
	CommandWindowReopen         CommandID = "window.reopen"
	CommandLayoutArrange        CommandID = "layout.arrange"
	CommandLayoutResize         CommandID = "layout.resize"
	CommandLayoutFrameResize    CommandID = "layout.frame_resize"
	CommandLayoutBalance        CommandID = "layout.balance"
	CommandLayoutUndo           CommandID = "layout.undo"
	CommandLayoutRedo           CommandID = "layout.redo"
	CommandLayoutReplace        CommandID = "layout.replace"
)

func CommandIDs

func CommandIDs() []CommandID

CommandIDs returns every daemon semantic window-manager action ID.

type CommandRequest

type CommandRequest struct {
	WorkspaceID      WorkspaceID
	CommandID        CommandID
	ExpectedRevision Revision
	// ClientID is required for desktop.switch and window.focus.
	ClientID *ClientID
	Actor    Actor
	Origin   string
	Rebase   *RebaseGuard
	Payload  Command
}

CommandRequest binds one semantic command to a workspace revision.

type Commit

type Commit struct {
	WorkspaceID      WorkspaceID
	ExpectedRevision Revision
	Snapshot         Snapshot
	Event            Event
}

Commit is the repository's atomic compare-and-swap unit.

type Config

type Config struct {
	NewWindowPolicy     NewWindowPolicy            `json:"new_window_policy"`
	SmallViewportPolicy SmallViewportPolicy        `json:"small_viewport_policy"`
	FocusPolicy         FocusPolicy                `json:"focus_policy"`
	FocusWrap           bool                       `json:"focus_wrap"`
	FocusFollowsPointer bool                       `json:"focus_follows_pointer"`
	RaiseOnFocus        bool                       `json:"raise_on_focus"`
	DragAwayPolicy      DragAwayPolicy             `json:"drag_away_policy"`
	GroupMoveModifier   string                     `json:"group_move_modifier"`
	SwapModifier        string                     `json:"swap_modifier"`
	HistoryLimit        int                        `json:"history_limit"`
	NavStackLimit       int                        `json:"nav_stack_limit"`
	ClosedEntryLimit    int                        `json:"closed_entry_limit"`
	DesktopTransition   DesktopTransition          `json:"desktop_transition"`
	Gaps                GapsConfig                 `json:"gaps"`
	Snap                SnapConfig                 `json:"snap"`
	Bindings            BindingsConfig             `json:"bindings"`
	Shortcuts           map[string]ShortcutBinding `json:"shortcuts,omitempty"`
}

Config is the effective global window-manager configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns production defaults from the accepted contract.

type Conflict

type Conflict struct {
	Code      string `json:"code"`
	EntityID  string `json:"entity_id,omitempty"`
	CurrentID string `json:"current_id,omitempty"`
}

Conflict identifies one stale reference that prevented a safe rebase.

type CreateDesktopCommand

type CreateDesktopCommand struct {
	DesktopID DesktopID
	Name      string
	AfterID   *DesktopID
}

func (CreateDesktopCommand) CommandID

func (CreateDesktopCommand) CommandID() CommandID

type DeleteDesktopCommand

type DeleteDesktopCommand struct {
	DesktopID     DesktopID
	DestinationID *DesktopID
}

func (DeleteDesktopCommand) CommandID

func (DeleteDesktopCommand) CommandID() CommandID

type Desktop

type Desktop struct {
	ID             DesktopID       `json:"id"`
	Name           string          `json:"name"`
	Order          int             `json:"order"`
	Groups         []LayoutGroup   `json:"groups"`
	Floating       []WindowID      `json:"floating"`
	FloatingStacks []FloatingStack `json:"floating_stacks"`
}

Desktop owns tiled groups and floating order.

type DesktopID

type DesktopID string

type DesktopTransition

type DesktopTransition string

DesktopTransition controls the client presentation used when switching desktops.

type Diagnostic

type Diagnostic struct {
	Code    string `json:"code"`
	Path    string `json:"path,omitempty"`
	Message string `json:"message"`
}

Diagnostic identifies one stable validation failure.

type DragAwayPolicy

type DragAwayPolicy string

DragAwayPolicy controls whether dragging detaches one window or its tiled group.

type DropPlacement

type DropPlacement string
const (
	DropFloating DropPlacement = "floating"
	DropBefore   DropPlacement = "before"
	DropAfter    DropPlacement = "after"
	DropLeft     DropPlacement = "left"
	DropRight    DropPlacement = "right"
	DropTop      DropPlacement = "top"
	DropBottom   DropPlacement = "bottom"
	DropCenter   DropPlacement = "center"
)

type Event

type Event struct {
	WorkspaceID WorkspaceID `json:"workspace_id"`
	Revision    Revision    `json:"revision"`
	CommandID   CommandID   `json:"command_id"`
	Changes     ChangeSet   `json:"changes"`
	Actor       Actor       `json:"actor"`
	Origin      string      `json:"origin,omitempty"`
	OccurredAt  time.Time   `json:"occurred_at"`
}

Event is published after one durable commit.

type EventObserver

type EventObserver func(context.Context, Event)

EventObserver receives an isolated copy of one observable committed event.

type ExtensionDefaultShortcut

type ExtensionDefaultShortcut struct {
	CommandID string
	Chord     string
	Source    string
	Active    bool
}

ExtensionDefaultShortcut is one ordered bind-if-free extension claim.

type ExtensionDefaultStatus

type ExtensionDefaultStatus struct {
	CommandID    string
	Binding      ShortcutBinding
	Source       string
	Dormant      bool
	ConflictWith string
}

ExtensionDefaultStatus explains whether one extension claim is effective.

type FloatingStack

type FloatingStack struct {
	ID        NodeID         `json:"id"`
	WindowIDs []WindowID     `json:"window_ids"`
	ActiveID  *WindowID      `json:"active_id,omitzero"`
	Rect      NormalizedRect `json:"rect"`
	Minimized bool           `json:"minimized"`
}

FloatingStack is one floating frame containing an ordered tab deck.

type FocusDirection

type FocusDirection string
const (
	FocusLeft  FocusDirection = "left"
	FocusRight FocusDirection = "right"
	FocusUp    FocusDirection = "up"
	FocusDown  FocusDirection = "down"
)

type FocusPolicy

type FocusPolicy string

FocusPolicy controls how pointer and directional focus interact.

type FocusWindowCommand

type FocusWindowCommand struct {
	WindowID  *WindowID
	Direction FocusDirection
}

func (FocusWindowCommand) CommandID

func (FocusWindowCommand) CommandID() CommandID

type FrameResizeLayoutCommand

type FrameResizeLayoutCommand struct {
	DesktopID DesktopID
	Edits     []GroupFrameEdit
}

FrameResizeLayoutCommand moves shared group boundaries by rewriting every affected island frame in one atomic, overlap-checked mutation.

func (FrameResizeLayoutCommand) CommandID

func (FrameResizeLayoutCommand) CommandID() CommandID

type GapsConfig

type GapsConfig struct {
	Inner  float64 `json:"inner"`
	Top    float64 `json:"top"`
	Right  float64 `json:"right"`
	Bottom float64 `json:"bottom"`
	Left   float64 `json:"left"`
}

GapsConfig defines the inner and outer layout gaps in CSS pixels.

type GlobalShortcutFailureObserver

type GlobalShortcutFailureObserver func(
	context.Context,
	WorkspaceID,
	ClientID,
	GlobalShortcutRegistration,
)

GlobalShortcutFailureObserver receives one changed shell registration failure.

type GlobalShortcutRegistration

type GlobalShortcutRegistration struct {
	CommandID     string               `json:"command_id"`
	IntendedChord string               `json:"intended_chord"`
	ActiveChord   string               `json:"active_chord,omitempty"`
	Status        GlobalShortcutStatus `json:"status"`
	Reason        string               `json:"reason,omitempty"`
	SettingsURL   string               `json:"settings_url,omitempty"`
}

GlobalShortcutRegistration is ephemeral shell-owned state for one command.

func CloneGlobalShortcutRegistrations

func CloneGlobalShortcutRegistrations(
	source []GlobalShortcutRegistration,
) []GlobalShortcutRegistration

CloneGlobalShortcutRegistrations returns an ownership-safe status slice.

type GlobalShortcutStatus

type GlobalShortcutStatus string

GlobalShortcutStatus reports the desktop shell's registration result for one intended chord.

const (
	GlobalShortcutRegistered       GlobalShortcutStatus = "registered"
	GlobalShortcutFailedInUse      GlobalShortcutStatus = "failed_in_use"
	GlobalShortcutFailedPermission GlobalShortcutStatus = "failed_permission"
	GlobalShortcutUnsupported      GlobalShortcutStatus = "unsupported"
)

type GroupFrameEdit

type GroupFrameEdit struct {
	GroupID GroupID
	Frame   NormalizedRect
}

GroupFrameEdit assigns one group frame inside an atomic multi-group resize.

type GroupID

type GroupID string

type GroupWindowsCommand

type GroupWindowsCommand struct {
	TargetWindowID WindowID   `json:"target_window_id"`
	WindowIDs      []WindowID `json:"window_ids"`
	InsertIndex    *int       `json:"insert_index,omitzero"`
}

func (GroupWindowsCommand) CommandID

func (GroupWindowsCommand) CommandID() CommandID

type History

type History struct {
	Undo []HistoryEntry `json:"undo"`
	Redo []HistoryEntry `json:"redo"`
}

History contains bounded undo and redo stacks.

type HistoryEntry

type HistoryEntry struct {
	CommandID CommandID
	Before    State
	After     State
	Actor     Actor
	Origin    string
	CreatedAt time.Time
}

HistoryEntry stores an exact operation boundary.

type LayoutAspectVariant

type LayoutAspectVariant string
const (
	LayoutAspectAny       LayoutAspectVariant = "any"
	LayoutAspectLandscape LayoutAspectVariant = "landscape"
	LayoutAspectPortrait  LayoutAspectVariant = "portrait"
)

type LayoutDocument

type LayoutDocument struct {
	Version     uint32              `json:"version"`
	WorkspaceID WorkspaceID         `json:"workspace_id"`
	Desktops    []Desktop           `json:"desktops"`
	Windows     map[WindowID]Window `json:"windows"`
	Overrides   WorkspaceConfig     `json:"overrides"`
}

LayoutDocument is the validated raw export and replacement contract.

type LayoutGroup

type LayoutGroup struct {
	ID    GroupID        `json:"id"`
	Frame NormalizedRect `json:"frame"`
	Root  LayoutNode     `json:"root"`
}

LayoutGroup is one independent tiled island.

type LayoutNode

type LayoutNode struct {
	ID        NodeID       `json:"id"`
	Kind      NodeKind     `json:"kind"`
	WindowID  *WindowID    `json:"window_id,omitzero"`
	Axis      *Axis        `json:"axis,omitzero"`
	Children  []LayoutNode `json:"children,omitempty"`
	Weights   []float64    `json:"weights,omitempty"`
	WindowIDs []WindowID   `json:"window_ids,omitempty"`
	ActiveID  *WindowID    `json:"active_id,omitzero"`
}

LayoutNode is a leaf, weighted split, or tabbed stack.

type LayoutOverflowPolicy

type LayoutOverflowPolicy string
const (
	LayoutOverflowStack  LayoutOverflowPolicy = "stack"
	LayoutOverflowReject LayoutOverflowPolicy = "reject"
)

type LayoutResource

type LayoutResource struct {
	Version          uint32               `json:"version"`
	ID               string               `json:"id"`
	DisplayName      string               `json:"display_name"`
	AspectVariant    LayoutAspectVariant  `json:"aspect_variant"`
	ParticipantSlots []WindowID           `json:"participant_slots,omitempty"`
	OverflowPolicy   LayoutOverflowPolicy `json:"overflow_policy"`
	Document         LayoutDocument       `json:"document"`
}

LayoutResource describes one declarative registry contribution.

func CloneLayoutResource

func CloneLayoutResource(resource LayoutResource) LayoutResource

CloneLayoutResource returns a deep copy safe for cross-package catalogs.

type LayoutResourceRegistry

type LayoutResourceRegistry interface {
	Resolve(ctx context.Context, workspaceID WorkspaceID, resourceID string) (LayoutDocument, error)
	List(ctx context.Context, workspaceID WorkspaceID) ([]LayoutResource, error)
}

LayoutResourceRegistry resolves validated declarative layout resources.

type Manager

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

Manager coordinates semantic commands, transient clients, and subscriptions.

func NewService

func NewService(
	repository Repository,
	workspaces WorkspaceResolver,
	layouts LayoutResourceRegistry,
	defaults Config,
	options ...Option,
) (*Manager, error)

NewService constructs the daemon-authoritative window manager.

func (*Manager) AttachClientCommands

func (m *Manager) AttachClientCommands(
	ctx context.Context,
	workspaceID WorkspaceID,
	clientID ClientID,
) (ClientCommandConnection, error)

AttachClientCommands binds one active command channel to an already registered client.

func (*Manager) AuthorizeClient

func (m *Manager) AuthorizeClient(
	ctx context.Context,
	workspaceID WorkspaceID,
	clientID ClientID,
	token string,
) error

AuthorizeClient validates one self-originated attachment token against its registered client.

func (*Manager) Clients

func (m *Manager) Clients(ctx context.Context, workspaceID WorkspaceID) ([]ClientView, error)

Clients lists connected views without leaking another workspace partition.

func (*Manager) Close

func (m *Manager) Close() error

Close terminates live subscriptions and rejects later operations.

func (*Manager) CommandClients

func (m *Manager) CommandClients(ctx context.Context, workspaceID WorkspaceID) ([]ClientView, error)

CommandClients lists registered views with an active command channel in this workspace.

func (*Manager) DeleteWorkspace

func (m *Manager) DeleteWorkspace(ctx context.Context, workspaceID WorkspaceID) error

DeleteWorkspace removes window state, clients, and subscriptions for an authorized workspace.

func (*Manager) DispatchClientCommand

func (m *Manager) DispatchClientCommand(
	ctx context.Context,
	workspaceID WorkspaceID,
	clientID ClientID,
	command ClientCommand,
) (ClientCommandResponse, error)

DispatchClientCommand sends one correlated command and waits for its terminal response.

func (*Manager) Execute

func (m *Manager) Execute(ctx context.Context, request CommandRequest) (Result, error)

Execute applies one semantic command through one compare-and-swap commit.

func (*Manager) ExportLayout

func (m *Manager) ExportLayout(ctx context.Context, workspaceID WorkspaceID) (LayoutDocument, error)

ExportLayout returns a history-free declarative document.

func (*Manager) ForgetWorkspace

func (m *Manager) ForgetWorkspace(workspaceID WorkspaceID)

ForgetWorkspace tears down transient state after the workspace owner commits deletion.

func (*Manager) LayoutResources

func (m *Manager) LayoutResources(ctx context.Context, workspaceID WorkspaceID) ([]LayoutResource, error)

LayoutResources lists declarative resources visible to a workspace.

func (*Manager) Preview

func (m *Manager) Preview(ctx context.Context, request CommandRequest) (Preview, error)

Preview reduces and validates without persisting, publishing, or advancing history.

func (*Manager) ReconcileDeletedSession

func (m *Manager) ReconcileDeletedSession(
	ctx context.Context,
	workspaceID WorkspaceID,
	sessionID string,
) error

ReconcileDeletedSession retires every durable window for one deleted session onto the empty session route and publishes the workspace event.

func (*Manager) RegisterClient

func (m *Manager) RegisterClient(ctx context.Context, registration ClientRegistration) (ClientView, error)

RegisterClient creates or refreshes one explicit client-local view.

func (*Manager) ReplaceLayout

func (m *Manager) ReplaceLayout(ctx context.Context, request ReplaceLayoutRequest) (Result, error)

ReplaceLayout applies a raw layout through the normal semantic command pipeline.

func (*Manager) Snapshot

func (m *Manager) Snapshot(ctx context.Context, workspaceID WorkspaceID) (Snapshot, error)

Snapshot returns a validated workspace aggregate.

func (*Manager) Subscribe

func (m *Manager) Subscribe(ctx context.Context, request SubscriptionRequest) (Subscription, error)

Subscribe returns one atomic topology/client fence followed by ordered updates.

func (*Manager) UnregisterClient

func (m *Manager) UnregisterClient(ctx context.Context, workspaceID WorkspaceID, clientID ClientID) error

UnregisterClient removes transient presentation state only.

func (*Manager) UpdateClientContext

func (m *Manager) UpdateClientContext(
	ctx context.Context,
	update ClientContextUpdate,
) (ClientView, error)

UpdateClientContext replaces client-owned palette context and derives topology-owned fields.

func (*Manager) UpdateDefaults

func (m *Manager) UpdateDefaults(defaults Config) error

UpdateDefaults atomically replaces validated runtime defaults for future commands.

func (*Manager) ValidateLayout

func (m *Manager) ValidateLayout(
	ctx context.Context,
	workspaceID WorkspaceID,
	document LayoutDocument,
) (Validation, error)

ValidateLayout checks a raw document without normalization or writes.

type MemoryRepository

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

MemoryRepository is an atomic repository for composition tests and ephemeral runtimes.

func NewMemoryRepository

func NewMemoryRepository() *MemoryRepository

NewMemoryRepository creates an empty workspace-partitioned repository.

func (*MemoryRepository) Commit

func (r *MemoryRepository) Commit(ctx context.Context, commit *Commit) error

func (*MemoryRepository) Commits

func (r *MemoryRepository) Commits(workspaceID WorkspaceID) []Commit

Commits returns an immutable copy of a workspace's transaction log.

func (*MemoryRepository) DeleteWorkspace

func (r *MemoryRepository) DeleteWorkspace(ctx context.Context, workspaceID WorkspaceID) error

func (*MemoryRepository) Load

func (r *MemoryRepository) Load(ctx context.Context, workspaceID WorkspaceID) (Snapshot, error)

type MemoryWorkspaceResolver

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

MemoryWorkspaceResolver provides explicit workspace registration for tests and ephemeral use.

func NewMemoryWorkspaceResolver

func NewMemoryWorkspaceResolver(workspaceIDs ...WorkspaceID) *MemoryWorkspaceResolver

NewMemoryWorkspaceResolver registers the supplied workspaces.

func (*MemoryWorkspaceResolver) Register

func (r *MemoryWorkspaceResolver) Register(workspaceID WorkspaceID)

Register makes a workspace resolvable.

func (*MemoryWorkspaceResolver) ResolveWorkspace

func (r *MemoryWorkspaceResolver) ResolveWorkspace(ctx context.Context, workspaceID WorkspaceID) error

func (*MemoryWorkspaceResolver) Unregister

func (r *MemoryWorkspaceResolver) Unregister(workspaceID WorkspaceID)

Unregister makes a workspace unavailable.

type MoveWindowCommand

type MoveWindowCommand struct {
	WindowID             WindowID
	DestinationDesktopID DesktopID
	TargetWindowID       *WindowID
	Placement            DropPlacement
	FloatingRect         *NormalizedRect
	MoveGroup            bool
}

func (MoveWindowCommand) CommandID

func (MoveWindowCommand) CommandID() CommandID
type NavigateMode string
const (
	NavigateReplace NavigateMode = ""
	NavigatePush    NavigateMode = "push"
	NavigatePop     NavigateMode = "pop"
)
type NavigateWindowCommand struct {
	WindowID WindowID    `json:"window_id"`
	Route    RouteIntent `json:"route,omitzero"`
	// InstanceKey retargets the window to another app instance in the same
	// navigation; valid only with replace mode and resets the nav stack.
	InstanceKey *string      `json:"instance_key,omitzero"`
	Mode        NavigateMode `json:"mode,omitempty"`
}
func (NavigateWindowCommand) CommandID() CommandID

type NewWindowPolicy

type NewWindowPolicy string

NewWindowPolicy controls how newly opened windows enter a desktop.

type NodeID

type NodeID string

type NodeKind

type NodeKind string
const (
	NodeKindLeaf  NodeKind = "leaf"
	NodeKindSplit NodeKind = "split"
	NodeKindStack NodeKind = "stack"
)

type NormalizedRect

type NormalizedRect struct {
	X      float64 `json:"x"`
	Y      float64 `json:"y"`
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
}

NormalizedRect is viewport-independent geometry in the closed unit square.

type OpenWindowCommand

type OpenWindowCommand struct {
	Window          WindowSpec
	RestoreWindowID *WindowID
}

func (OpenWindowCommand) CommandID

func (OpenWindowCommand) CommandID() CommandID

type Option

type Option func(*managerOptions) error

Option customizes the manager without introducing operational globals.

func WithAppDeprecationObserver

func WithAppDeprecationObserver(observer AppDeprecationObserver) Option

WithAppDeprecationObserver observes public aliases until removal in v0.5.0.

func WithClientUnregisteredObserver

func WithClientUnregisteredObserver(observer ClientUnregisteredObserver) Option

WithClientUnregisteredObserver observes a client after its local state is removed.

func WithClock

func WithClock(now func() time.Time) Option

WithClock injects deterministic commit and client timestamps.

func WithEventObserver

func WithEventObserver(observer EventObserver) Option

WithEventObserver observes lifecycle events after their durable commit succeeds.

func WithGlobalShortcutFailureObserver

func WithGlobalShortcutFailureObserver(observer GlobalShortcutFailureObserver) Option

WithGlobalShortcutFailureObserver observes shell registration failures.

func WithIDGenerator

func WithIDGenerator(generate func(string) (string, error)) Option

WithIDGenerator injects deterministic entity identifiers.

func WithLifecycleContext

func WithLifecycleContext(ctx context.Context) Option

WithLifecycleContext preserves boot-scoped values for detached background work.

func WithSubscriptionBuffer

func WithSubscriptionBuffer(size int) Option

WithSubscriptionBuffer configures bounded subscriber backpressure.

func WithWorkspaceConfigResolver

func WithWorkspaceConfigResolver(resolver WorkspaceConfigResolver) Option

WithWorkspaceConfigResolver resolves workspace-scoped runtime behavior.

type PaletteContext

type PaletteContext struct {
	WindowFocused       bool         `json:"window_focused"`
	WindowFloating      bool         `json:"window_floating"`
	WindowStacked       bool         `json:"window_stacked"`
	DesktopWindowCount  int          `json:"desktop_window_count"`
	ScopeGlobal         bool         `json:"scope_global"`
	ShellDesktop        bool         `json:"shell_desktop"`
	FocusedSessionState string       `json:"focused_session_state,omitempty"`
	WorkspaceTrusted    bool         `json:"workspace_trusted"`
	DestinationIntent   *RouteIntent `json:"destination_intent,omitzero"`
}

PaletteContext is the volatile, client-targeted availability snapshot.

type PinWindowCommand

type PinWindowCommand struct {
	WindowID WindowID `json:"window_id"`
	Pinned   bool     `json:"pinned"`
}

func (PinWindowCommand) CommandID

func (PinWindowCommand) CommandID() CommandID

type Preview

type Preview struct {
	Snapshot    Snapshot     `json:"snapshot"`
	Changed     bool         `json:"changed"`
	Changes     ChangeSet    `json:"changes"`
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
	Client      *ClientView  `json:"client,omitzero"`
}

Preview reports a validated proposal without a durable write.

type RebaseGuard

type RebaseGuard struct {
	WindowID      *WindowID
	SourceNodeID  *NodeID
	TargetNodeID  *NodeID
	SplitID       *NodeID
	BoundaryIndex *int
}

RebaseGuard proves stale source and target identities are still unambiguous.

type RedoLayoutCommand

type RedoLayoutCommand struct{}

func (RedoLayoutCommand) CommandID

func (RedoLayoutCommand) CommandID() CommandID

type ReopenCommand

type ReopenCommand struct{}

func (ReopenCommand) CommandID

func (ReopenCommand) CommandID() CommandID

type ReorderDesktopCommand

type ReorderDesktopCommand struct {
	DesktopID DesktopID
	Order     int
}

func (ReorderDesktopCommand) CommandID

func (ReorderDesktopCommand) CommandID() CommandID

type ReorderStackCommand

type ReorderStackCommand struct {
	WindowID WindowID `json:"window_id"`
	Index    int      `json:"index"`
}

func (ReorderStackCommand) CommandID

func (ReorderStackCommand) CommandID() CommandID

type ReplaceLayoutCommand

type ReplaceLayoutCommand struct{ Document LayoutDocument }

func (ReplaceLayoutCommand) CommandID

func (ReplaceLayoutCommand) CommandID() CommandID

type ReplaceLayoutRequest

type ReplaceLayoutRequest struct {
	WorkspaceID      WorkspaceID
	ExpectedRevision Revision
	ClientID         *ClientID
	Actor            Actor
	Origin           string
	Document         LayoutDocument
}

ReplaceLayoutRequest applies a validated document with normal revision CAS.

type Repository

type Repository interface {
	Load(ctx context.Context, workspaceID WorkspaceID) (Snapshot, error)
	Commit(ctx context.Context, commit *Commit) error
	// DeleteWorkspace is atomic: an error leaves the workspace state unchanged.
	DeleteWorkspace(ctx context.Context, workspaceID WorkspaceID) error
}

Repository stores the complete aggregate atomically.

type ResizeLayoutCommand

type ResizeLayoutCommand struct {
	SplitID       NodeID
	BoundaryIndex int
	Delta         float64
}

func (ResizeLayoutCommand) CommandID

func (ResizeLayoutCommand) CommandID() CommandID

type ResizeWindowCommand

type ResizeWindowCommand struct {
	WindowID WindowID
	Frame    NormalizedRect
}

ResizeWindowCommand assigns a normalized frame to the unit containing the window: a floating rect, a floating stack rect, a solo group frame, or a split member that detaches into its own island at the requested frame.

func (ResizeWindowCommand) CommandID

func (ResizeWindowCommand) CommandID() CommandID

type Result

type Result struct {
	Snapshot    Snapshot     `json:"snapshot"`
	Applied     bool         `json:"applied"`
	Changes     ChangeSet    `json:"changes"`
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
	Client      *ClientView  `json:"client,omitzero"`
	RebasedFrom *Revision    `json:"rebased_from,omitzero"`
}

Result reports one applied or no-op command.

type ReturnAnchor

type ReturnAnchor struct {
	DesktopID      DesktopID      `json:"desktop_id"`
	GroupID        *GroupID       `json:"group_id,omitzero"`
	ParentSplitID  *NodeID        `json:"parent_split_id,omitzero"`
	ChildIndex     *int           `json:"child_index,omitzero"`
	Weight         *float64       `json:"weight,omitzero"`
	NeighborIDs    []WindowID     `json:"neighbor_ids,omitempty"`
	SourceRevision Revision       `json:"source_revision"`
	SourceGroup    *LayoutGroup   `json:"source_group,omitzero"`
	SourceStack    *FloatingStack `json:"source_stack,omitzero"`
	// Zoomed restores the zoom a minimized window held when it left.
	Zoomed bool `json:"zoomed,omitzero"`
}

ReturnAnchor describes a window's prior structural slot.

type Revision

type Revision uint64

func NextTopologyRevision

func NextTopologyRevision(current Revision) (Revision, error)

NextTopologyRevision returns the next JSON-safe durable topology revision.

type RevisionConflictError

type RevisionConflictError struct {
	Expected Revision
	Current  Revision
	Details  []Conflict
}

RevisionConflictError reports the current revision and failed rebase guards.

func (*RevisionConflictError) Error

func (e *RevisionConflictError) Error() string

func (*RevisionConflictError) Unwrap

func (e *RevisionConflictError) Unwrap() error

type RouteIntent

type RouteIntent struct {
	Pathname string      `json:"pathname"`
	Search   RouteSearch `json:"search"`
}

RouteIntent is one application-internal durable navigation target.

func CanonicalRouteIntent

func CanonicalRouteIntent(route RouteIntent) (RouteIntent, error)

CanonicalRouteIntent validates and normalizes a durable application route.

func RewriteRetiredAppRoute

func RewriteRetiredAppRoute(app string, route RouteIntent) RouteIntent

func (*RouteIntent) UnmarshalJSON

func (route *RouteIntent) UnmarshalJSON(data []byte) error

UnmarshalJSON rejects incomplete, external, or non-object route intents.

type RouteSearch

type RouteSearch map[string]json.RawMessage

RouteSearch is a canonical JSON object containing durable route search state.

type SetStackActiveCommand

type SetStackActiveCommand struct {
	WindowID WindowID `json:"window_id"`
}

func (SetStackActiveCommand) CommandID

func (SetStackActiveCommand) CommandID() CommandID

type ShortcutBinding

type ShortcutBinding []string

ShortcutBinding is one action's ordered shortcut list. An empty binding disables the action.

func (*ShortcutBinding) UnmarshalJSON

func (b *ShortcutBinding) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts the public v2 string-or-array shape.

func (*ShortcutBinding) UnmarshalTOML

func (b *ShortcutBinding) UnmarshalTOML(value any) error

UnmarshalTOML accepts the v2 untagged string-or-array shape.

type ShortcutConflictError

type ShortcutConflictError struct {
	Chord   string
	Owner   string
	Command string
}

ShortcutConflictError identifies both owners of one chord.

func (*ShortcutConflictError) Error

func (e *ShortcutConflictError) Error() string

func (*ShortcutConflictError) Unwrap

func (e *ShortcutConflictError) Unwrap() error

type ShortcutDiagnostic

type ShortcutDiagnostic struct {
	CommandID string `json:"command_id"`
	Message   string `json:"message"`
}

ShortcutDiagnostic reports a stored keymap entry omitted from the effective map.

func TolerantEffectiveKeymap

func TolerantEffectiveKeymap(
	overrides map[string]ShortcutBinding,
	bindableIDs BindableIDs,
) (map[string]ShortcutBinding, []ShortcutDiagnostic, error)

TolerantEffectiveKeymap drops dead stored ids while preserving live overrides.

type SmallViewportPolicy

type SmallViewportPolicy string

SmallViewportPolicy controls layout behavior when the viewport cannot fit a tiled arrangement.

type SnapConfig

type SnapConfig struct {
	EdgeBand     float64   `json:"edge_band"`
	CornerReach  float64   `json:"corner_reach"`
	ExitSlack    float64   `json:"exit_slack"`
	RepeatRatios []float64 `json:"repeat_ratios"`
}

SnapConfig defines pointer thresholds and repeated edge-snap ratios.

type Snapshot

type Snapshot struct {
	Version       uint32              `json:"version"`
	WorkspaceID   WorkspaceID         `json:"workspace_id"`
	Revision      Revision            `json:"revision"`
	Desktops      []Desktop           `json:"desktops"`
	Windows       map[WindowID]Window `json:"windows"`
	ClosedEntries []ClosedEntry       `json:"closed_entries,omitempty"`
	History       History             `json:"history"`
	Overrides     WorkspaceConfig     `json:"overrides"`
	UpdatedAt     time.Time           `json:"updated_at"`
}

Snapshot is the complete durable workspace aggregate.

func MigrateLegacySnapshotV3

func MigrateLegacySnapshotV3(encoded []byte) (Snapshot, error)

MigrateLegacySnapshotV3 chains v3 through the v4 geometry and v5 app identities. A focus desktop becomes a regular desktop whose owner is zoomed on it with its return anchor intact, exactly like a unit that zoom lifted there; layout history does not survive because its entries carry the old shape. The result carries the next revision: its content differs from what any client cached under the stored revision.

func MigrateSnapshotV4

func MigrateSnapshotV4(encoded []byte) (Snapshot, error)

func NormalizeSnapshot

func NormalizeSnapshot(snapshot Snapshot) Snapshot

NormalizeSnapshot deterministically repairs unambiguous representational residue.

func ReconcileRegisteredApps

func ReconcileRegisteredApps(snapshot Snapshot, registered func(app string) bool) (Snapshot, bool)

ReconcileRegisteredApps removes retired apps and repairs their durable topology without mutating its input.

type State

type State struct {
	Desktops  []Desktop
	Windows   map[WindowID]Window
	Overrides WorkspaceConfig
}

State is the revision-independent content restored by history.

type Subscription

type Subscription interface {
	Fence() SubscriptionFence
	Updates() <-chan SubscriptionUpdate
	Err() error
	Close() error
}

Subscription fences current state and later ordered updates.

type SubscriptionFence

type SubscriptionFence struct {
	Snapshot Snapshot
	Client   *ClientView
}

SubscriptionFence atomically captures durable topology and optional presentation state.

type SubscriptionRequest

type SubscriptionRequest struct {
	WorkspaceID   WorkspaceID
	AfterRevision Revision
	ClientID      *ClientID
}

SubscriptionRequest binds an optional client view to one stream.

type SubscriptionUpdate

type SubscriptionUpdate struct {
	Event  *Event
	Client *ClientView
}

SubscriptionUpdate carries one ordered topology or client presentation change.

type SwapWindowsCommand

type SwapWindowsCommand struct {
	FirstWindowID  WindowID
	SecondWindowID WindowID
}

func (SwapWindowsCommand) CommandID

func (SwapWindowsCommand) CommandID() CommandID

type SwitchDesktopCommand

type SwitchDesktopCommand struct{ DesktopID DesktopID }

func (SwitchDesktopCommand) CommandID

func (SwitchDesktopCommand) CommandID() CommandID

type ToggleFloatingCommand

type ToggleFloatingCommand struct {
	WindowID     WindowID
	FloatingRect *NormalizedRect
}

func (ToggleFloatingCommand) CommandID

func (ToggleFloatingCommand) CommandID() CommandID

type TopologyError

type TopologyError struct {
	Diagnostics []Diagnostic
}

TopologyError reports all independently detectable topology violations.

func (*TopologyError) Error

func (e *TopologyError) Error() string

func (*TopologyError) Unwrap

func (e *TopologyError) Unwrap() error

type UndoLayoutCommand

type UndoLayoutCommand struct{}

func (UndoLayoutCommand) CommandID

func (UndoLayoutCommand) CommandID() CommandID

type UnknownShortcutIDError

type UnknownShortcutIDError struct {
	CommandID string
}

UnknownShortcutIDError reports an attempted binding outside the catalog.

func (*UnknownShortcutIDError) Error

func (e *UnknownShortcutIDError) Error() string

func (*UnknownShortcutIDError) Unwrap

func (e *UnknownShortcutIDError) Unwrap() error

type UpdateDesktopCommand

type UpdateDesktopCommand struct {
	DesktopID DesktopID
	Name      string
}

func (UpdateDesktopCommand) CommandID

func (UpdateDesktopCommand) CommandID() CommandID

type Validation

type Validation struct {
	Valid       bool         `json:"valid"`
	Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}

Validation reports stable layout diagnostics.

type Window

type Window struct {
	ID           WindowID        `json:"id"`
	App          string          `json:"app"`
	InstanceKey  *string         `json:"instance_key,omitzero"`
	Route        RouteIntent     `json:"route"`
	NavStack     []RouteIntent   `json:"nav_stack"`
	Pinned       bool            `json:"pinned"`
	Placement    WindowPlacement `json:"placement"`
	DesktopID    DesktopID       `json:"desktop_id"`
	FloatingRect NormalizedRect  `json:"floating_rect"`
	Minimized    bool            `json:"minimized"`
	// Zoomed fills the desktop work area with the unit holding this window.
	Zoomed       bool          `json:"zoomed"`
	ReturnAnchor *ReturnAnchor `json:"return_anchor,omitzero"`
}

Window is one durable application instance.

type WindowID

type WindowID string

type WindowPlacement

type WindowPlacement string
const (
	WindowPlacementTiled    WindowPlacement = "tiled"
	WindowPlacementStacked  WindowPlacement = "stacked"
	WindowPlacementFloating WindowPlacement = "floating"
)

type WindowSpec

type WindowSpec struct {
	ID           WindowID       `json:"id,omitempty"`
	App          string         `json:"app"`
	InstanceKey  *string        `json:"instance_key,omitzero"`
	Route        RouteIntent    `json:"route"`
	DesktopID    DesktopID      `json:"desktop_id"`
	FloatingRect NormalizedRect `json:"floating_rect"`
	InsertTiled  bool           `json:"insert_tiled,omitzero"`
	// Floating opens a free window at FloatingRect whatever the new-window
	// policy; it cannot be combined with a tiled or stacked placement.
	Floating            bool      `json:"floating,omitzero"`
	StackTargetWindowID *WindowID `json:"stack_target_window_id,omitzero"`
	// BesideWindowID anchors a tiled open (beside_focus, tab, or InsertTiled)
	// to this window instead of the client's focus. Daemon-originated opens
	// have no client focus; they name the window the new one belongs next to.
	BesideWindowID *WindowID `json:"beside_window_id,omitzero"`
}

type WorkspaceConfig

type WorkspaceConfig struct {
	NewWindowPolicy     *NewWindowPolicy           `json:"new_window_policy,omitzero"`
	SmallViewportPolicy *SmallViewportPolicy       `json:"small_viewport_policy,omitzero"`
	FocusPolicy         *FocusPolicy               `json:"focus_policy,omitzero"`
	FocusWrap           *bool                      `json:"focus_wrap,omitzero"`
	FocusFollowsPointer *bool                      `json:"focus_follows_pointer,omitzero"`
	RaiseOnFocus        *bool                      `json:"raise_on_focus,omitzero"`
	DragAwayPolicy      *DragAwayPolicy            `json:"drag_away_policy,omitzero"`
	GroupMoveModifier   *string                    `json:"group_move_modifier,omitzero"`
	SwapModifier        *string                    `json:"swap_modifier,omitzero"`
	HistoryLimit        *int                       `json:"history_limit,omitzero"`
	NavStackLimit       *int                       `json:"nav_stack_limit,omitzero"`
	ClosedEntryLimit    *int                       `json:"closed_entry_limit,omitzero"`
	DesktopTransition   *DesktopTransition         `json:"desktop_transition,omitzero"`
	Gaps                *GapsConfig                `json:"gaps,omitzero"`
	Snap                *SnapConfig                `json:"snap,omitzero"`
	Bindings            *BindingsConfig            `json:"bindings,omitzero"`
	Shortcuts           map[string]ShortcutBinding `json:"shortcuts,omitempty"`
}

WorkspaceConfig contains optional workspace overrides.

type WorkspaceConfigResolver

type WorkspaceConfigResolver interface {
	ResolveWindowManagerConfig(context.Context, WorkspaceID, Config) (Config, error)
}

WorkspaceConfigResolver overlays workspace-scoped behavior onto active defaults.

type WorkspaceID

type WorkspaceID string
const GlobalDesktopWorkspaceID WorkspaceID = "global"

GlobalDesktopWorkspaceID is the reserved profile-owned desktop partition used when the operator has no project workspace. It never grants workspace data scope.

type WorkspaceResolver

type WorkspaceResolver interface {
	ResolveWorkspace(ctx context.Context, workspaceID WorkspaceID) error
}

WorkspaceResolver authorizes and resolves a workspace before state access.

type ZoomWindowCommand

type ZoomWindowCommand struct{ WindowID WindowID }

func (ZoomWindowCommand) CommandID

func (ZoomWindowCommand) CommandID() CommandID

Source Files

Jump to

Keyboard shortcuts

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