Documentation
¶
Index ¶
- func EstimateRenderedBounds(info contract.WindowInfo) (contract.Bounds, bool)
- func Focus(ctx context.Context, target Target) (contract.WindowInfo, error)
- func Focused(ctx context.Context) (*contract.WindowInfo, error)
- func List(ctx context.Context) ([]contract.WindowInfo, error)
- func SupportedAtoms(ctx context.Context) (map[string]bool, error)
- type MaximizeRequest
- type MoveRequest
- type ResizeRequest
- type Target
- type VerbResult
- func Close(ctx context.Context, target Target) (VerbResult, error)
- func Maximize(ctx context.Context, req MaximizeRequest) (VerbResult, error)
- func Minimize(ctx context.Context, target Target) (VerbResult, error)
- func Move(ctx context.Context, req MoveRequest) (VerbResult, error)
- func Raise(ctx context.Context, target Target) (VerbResult, error)
- func Resize(ctx context.Context, req ResizeRequest) (VerbResult, error)
- func Workspace(ctx context.Context, req WorkspaceRequest) (VerbResult, error)
- type VerbWarning
- type WorkspaceRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateRenderedBounds ¶ added in v0.3.1
func EstimateRenderedBounds(info contract.WindowInfo) (contract.Bounds, bool)
EstimateRenderedBounds returns a best-effort inner rectangle where the window's rendered surface stops, based on the texture-aware patch-vs-desktop heuristic used by detectGeometryDivergence. Exported so the `windows --detect-rendered` flag can attach a `rendered_bounds_estimate` to each window record. Returns the input bounds (and ok=false) when the heuristic cannot run (undecidable desktop, sampling failure) or when no divergence is detected.
Types ¶
type MaximizeRequest ¶
type MaximizeRequest struct {
Target Target `json:"target"`
Axis string `json:"axis,omitempty" jsonschema:"both, horz, or vert; defaults to both"`
}
MaximizeRequest describes a window_maximize action.
type MoveRequest ¶
MoveRequest describes a window_move action.
type ResizeRequest ¶
type ResizeRequest struct {
Target Target `json:"target"`
Width int `json:"width"`
Height int `json:"height"`
}
ResizeRequest describes a window_resize action.
type Target ¶
type Target = contract.WindowTarget
Target is the WM-agnostic window selector used by focus_window and every window_* verb. It mirrors contract.WindowTarget exactly so internal callers can use either name; the alias keeps task-1's wire shape on Action.Target and Point.Target unified with the focus_window input.
type VerbResult ¶
type VerbResult struct {
Window contract.WindowInfo `json:"window"`
Notes []string `json:"notes,omitempty"`
Warning *VerbWarning `json:"warning,omitempty"`
}
VerbResult captures the post-op window plus any warning notes the verb produced (e.g. WINDOW_GEOMETRY_REFUSED).
func Close ¶
func Close(ctx context.Context, target Target) (VerbResult, error)
Close requests window closure via _NET_CLOSE_WINDOW. CLI/MCP-layer callers must gate this behind --allow-close (or the batch-level allow_close flag); this function itself is unconditional so unit tests and audit paths can exercise it.
func Maximize ¶
func Maximize(ctx context.Context, req MaximizeRequest) (VerbResult, error)
Maximize toggles the maximized state on the requested axis (both, horz, vert). Defaults to both.
func Minimize ¶
func Minimize(ctx context.Context, target Target) (VerbResult, error)
Minimize iconifies the window via WM_CHANGE_STATE (IconicState=3). EWMH's _NET_WM_STATE_HIDDEN is read-only per spec, so the legacy WM_CHANGE_STATE client message is the correct hammer.
func Move ¶
func Move(ctx context.Context, req MoveRequest) (VerbResult, error)
Move performs window_move via _NET_MOVERESIZE_WINDOW with static gravity. Post-op compares the new outer bounds against the request; a divergence beyond geometryTolerance raises WINDOW_GEOMETRY_REFUSED.
func Raise ¶
func Raise(ctx context.Context, target Target) (VerbResult, error)
Raise activates and stacks the window above its siblings. Uses _NET_ACTIVE_WINDOW then falls back to ConfigureWindow+stack-above.
func Resize ¶
func Resize(ctx context.Context, req ResizeRequest) (VerbResult, error)
Resize performs window_resize via _NET_MOVERESIZE_WINDOW.
func Workspace ¶
func Workspace(ctx context.Context, req WorkspaceRequest) (VerbResult, error)
Workspace moves the window to the desktop at the given zero-based index via _NET_WM_DESKTOP.
type VerbWarning ¶
type VerbWarning struct {
Code string `json:"code"`
Message string `json:"message"`
Details map[string]any `json:"details,omitempty"`
}
VerbWarning is a structured non-fatal warning attached to a verb result. ok:true on the action; the agent decides recovery.
type WorkspaceRequest ¶
WorkspaceRequest describes a window_workspace action.