The GStreamer bindings read the target with target-lexicon (Apache-2.0 with the LLVM exception), and
zbus's zvariant family, which eframe's accessibility layer used on Linux already, is flagged as
unmaintained; each is listed with its reason.
logind's PrepareForSleep on the system bus, and the screen saver's ActiveChanged on the session
bus, which komorebi for KDE listens to as well; GetActive says whether the screen is locked.
A Wayland client cannot list the windows of other programs, so the list is komorebi's own state:
each window with its rect and program, shown when its workspace is showing and it is in front of
its stack. --window-track is allowed on Linux.
KWin offers zkde_screencast_unstable_v1 only to a program whose desktop file lists it. The note
has the file to write, with the path of this executable in it.
The displays are the compositor's outputs, with the id komorebi for KDE gives a monitor with no
serial number. A screencast of one is a PipeWire node that pipewiresrc reads, stamped on the
master clock, into a segment written by the capture writer. KWin offers the screencast only to
a program whose desktop file asks for it, and says so when it does not.
DisplayCapture::start_with takes a function that connects a source to the frames' sink, which
also hears why a source died. Frames are placed in the file's time, logged and measured as on
Windows, a still display has its last frame repeated, and the file is fragmented H.264 written
by x264enc and mp4mux. The tests are a source of their own, and read the video back with the
decoder. The default codec on Linux is H.264.
One connection and a thread that reads its events keep the list of outputs, hotplug included,
so asking for it is cheap. A screencast of an output is KDE's zkde_screencast_unstable_v1,
which gives a PipeWire node and asks the user nothing.
A pipeline per decode, filesrc ! decodebin ! videoconvert ! videoscale ! appsink, gives BGRA
frames at the size asked for. The time of a frame is its stream time, because an MP4's edit
list puts the media time of the first frame after zero. The playback and viewer tests that
need decoded video pass on Linux.
Flavor::Kde is the flavor of a Linux host. Its rules are checked against a log and events
of komorebi for KDE's in-memory desktop, but not against a real desktop, so an analysis
of a KDE session says so. There are no ghost tiles for it yet.
The window's Wayland application id is komorebi-recorder; komorebic ignore-rule class
registers it before the window exists, as the exe rule does on Windows.
The recorder is now the pinned first tab (Record, not closable, with a REC
marker while recording) of the viewer window; sessions follow as tabs. There
is one process and one window: komorebi-recorder, gui and view all claim the
same socket, and a second launch forwards (gui shows the Record tab, view
opens tabs) and exits. The request protocol gains an optional "tab" field;
old requests still parse. gui takes the record options (they only seed the
window that is started) and --new-window.
The window starts compact (420x380, always on top, Record tab only) when
launched plainly and full size for view; opening any session expands it,
and Compact / Expand is remembered in the prefs. RecorderApp::poll runs on
every frame whichever tab is showing, so recordings continue and finalize
while another tab is looked at. Cmd/Ctrl+0 shows the Record tab; Cmd/Ctrl+W
on it does nothing; closing the last session tab returns to Record.
KOMOREBI_RECORDER_PREFS_DIR and KOMOREBI_RECORDER_NO_IGNORE_RULE let tests
and end-to-end runs avoid the real prefs and the real komorebi.
The macOS/unix cfg branches (hidden title bar spacing) mirror the existing
tested patterns and could not be compiled on the Windows machine this was
written on.
The viewer is now one window with a tab per session. Opening a session
(Open..., recents, the recorder window's buttons, `view SESSION...`) follows
one rule: focus the tab that has it, else load into the current start-screen
or failed tab, else add a tab. Only the tab in view plays; closing a tab
cancels its scan and stops its playback. Keys: Cmd/Ctrl T, W, 1-9,
Ctrl+Tab (and Cmd+Shift+[ ] on a Mac).
`view` and the recorder window hand sessions to a running viewer over a
local socket (komorebi-recorder-viewer.sock in the data dir, one JSON line
each way) and only start a process when none answers; `view --new-window`
opts out. The socket uses komorebi_link's cfg pattern (std unix sockets, or
uds_windows on Windows). The unix/macOS branches could not be compiled
here, only the Windows one.
The recorder and viewer windows were untitled so komorebi would not tile
them. They now get the title komorebi-recorder, but only when that is safe:
before the window exists, on Windows, the recorder runs
komorebic ignore-rule exe <name> (live rule, nothing persisted, 3 s timeout,
no console) for its own exe and komorebi-recorder-gui.exe. Registered, or no
komorebi running, means titled; komorebic missing or failing, and every
non-Windows host, stays untitled with one line on stderr (and in the
recorder window's message area). doctor gains a dry-check line.
No macOS-specific code was added (cfg!(windows) only); nothing here was
built for macOS.
assert <session> --check "<kind> <args> <metric><op><number>" evaluates checks
with the existing analyses (findings, logq, motion, blank, annotations), one
Check trait and one registry line per kind. Exit 6 (ExitKind::Assertion) when a
check fails; checks that cannot be measured are errors (2/3/4), never a pass.
JSON envelope assert/1.
Spike with logman and tracerpt against Win32k, User32, Dwm-Core and
Shell-Core while driving a throwaway window. Sessions start without
elevation, but no event carries a window's rect, flags or caller.
Recommends not building an ETW tap.
`komorebi-recorder mark "text"` appends a point note (author script) to the
session being recorded, found by --session, KOMOREBI_RECORDER_SESSION or the
newest running recording. Notes now show as ticks on the viewer's bug lane.
record --until-exit -- <command> runs the command while recording (with
KOMOREBI_RECORDER_SESSION set) and stops when it exits; its status is reported
apart from the recorder's. record, displays, reindex and selftest take --json
(record/1, displays/1, reindex/1, selftest/1). brief --compact is a 40-line
brief, and findings merges detector findings (with stable f-xxxxxx ids) with
an agent's. annotate --ref log:"text" / log:HH:MM:SS.mmm / log:<video time>
resolves to a log line and says which.
record --window-track[=HZ] (off by default, 30 Hz without a value, 1..=120)
writes windows.jsonl: a sampler thread lists every top-level window once per
tick and writes the full window list only when something changed, plus a
keyframe each second, so a still desktop costs about a row a second.
platform::window::list gives generic facts (Windows: EnumWindows + DWM
cloaked/frame bounds; macOS: CGWindowList bounds and on-screen flag).
The manifest records the track (rows, late ticks) and warns if it stopped
or fell behind. Analysis::window_track answers 'windows at mach_ns T', and
sheet --windows draws each window's rect and label on every frame (cloaked
windows dim), or notes that the session has no track.
The macOS part (platform/macos/apps.rs window_list) was written against the
objc2 sources and is NOT built or run: this was developed on Windows.
Built-in frame analysis for agents that scripted ffmpeg tblend/signalstats.
motion is changes with an optional --region (display points) and a peak
mean luma delta; framediff compares two frames (or one moment of two
recordings with --against) with an optional PNG; blank reports stretches
where a region is near-uniform (named colour) or frozen; compare sets two
recordings side by side. changes now shares the engine with motion and
behaves as before. The crop API takes a rect so a window rect can be
passed later. No macOS-specific code touched (not buildable here).
logq <session> 'level=ERROR and hwnd=0x77179C' filters komorebi.log by
level, target, message, line, the span chain, the handled command and
event, or any span field, with and/or/parentheses, = != ~ !~, --count,
--group-by, --from/--to and a paged logq/1 envelope whose hits carry log:N
references. hwnd compares equal in decimal and hex. logparse keeps the
span chain as written (Line::chain).
at, range, frames and locate --utc now read any TimeSpec form (falling back to
video timecodes, so existing usage is unchanged). New: logtime:HH:MM:SS[.mmm[uuu]]
(also log-time: and wall:HH:MM:SS), a UTC time of day on the session's date, the
one inside the recording if it crosses midnight. A bare time of day stays video time.
komorebi's own send time (its 'pushed notification' log line) is now lined up with
events in order, so an event received long after it was sent still pairs with its
handler. Pair gains pushed_mach_ns and delivery_ms, and a handler view shows
pushed_video_s and delivery_ms beside the receive time. slow-handler without a push
time is info and says it may be delivery delay; a new delivery-batching finding
(info) describes notifications delivered in clumps. A bare process_command{Cmd(arg)}
span is now read as the command (it was nameless), and commands that differ only in
arguments are separate handlers.
No cfg(target_os = "macos") code touched.
Windows Graphics Capture holds a capture to 60 frames a second unless it is
given a minimum update interval, so a 120 Hz display was recorded at half its
rate and a one-refresh flash could fall between two frames. ScreenCaptureKit
was asked for at most 30 (the default --fps), so macOS lost frames the same
way.
--fps now means the most frames a second, and 0, the new default, means no
cap: Windows sets the session's minimum update interval to a millisecond (or
a frame at --fps), and macOS sets a zero minimum frame interval. The encoder
is told 60 fps when there is no cap.
On Windows each sample was also stamped to last 1/fps whatever the gap to the
next frame. A frame is now held until the next arrives and given the real
time between them; the last one still gets a frame at the nominal rate. macOS
passes ScreenCaptureKit's own sample timing through, so needs no change.
Checked on a Mac with a 120 Hz display and komorebi for Mac running: with no
cap a display is recorded a frame every 8.3 ms, and --fps 30 holds it to about
30 a second. The video holds as many frames as the frame log has rows, and the
state komorebi was recorded in matches what the frames show. The macOS encoder
never reads fps, so CaptureConfig::fps now says it reaches only the Windows
one.