Skip to content

windows.list

The windows that reported to the daemon, the most recently focused first: workspace, thread, view, errors, and the native window of an omfp desktop window (desktop: { host, pid, title }, PRT-123, PRT-460). The title follows the window’s thread or view (<thread> — omfp · <n>): to match a window manager’s window by pid and title, read this right before matching.

/** `windows.list` params (PRT-123). */
export type ListWindowsParams = {
/** Only the windows showing this workspace; every window when absent. */
workspaceId?: string | null;
};
/** `windows.list` result (PRT-123). */
export type WindowList = {
/** The windows that reported, the most recently focused first. */
windows: WindowSummary[];
};
/** One window of `windows.list` (PRT-123). */
export type WindowSummary = {
activeView?: string | null;
/** The `client` of its `system.hello`. */
client: string;
/** Its native desktop window (PRT-460): find it among the window manager's by `pid` and `title`; `null` in a browser. */
desktop: DesktopWindow | null;
/** How many errors it shows: init files (`fileErrors`) and widgets in an error state. */
errors: number;
focused: boolean;
threadId?: string | null;
/** The window's connection number (`system.hello`'s `connection`). */
windowId: number;
/** The workspace it shows; `null` for none. */
workspaceId?: string | null;
};
/**
* The native window of an `omfp desktop` window (PRT-460, UI-1231, UI-1232), as its shell made it: the machine and
* process of the shell (every window of a data directory shares the process) and the window's current title, unique
* among the windows of the process. The window manager's list of windows finds it by `pid` and `title`; the title
* follows the window's thread, so read it right before matching.
*/
export type DesktopWindow = {
/** The host name of the machine the shell runs on. */
host: string;
/** The shell's process id. */
pid: number;
/** The native window's current title, `<thread or view> — omfp · <n>` or `omfp · <n>` (UI-1231). */
title: string;
};