The icon cache (IconsCache, ICONS_CACHE, ImageIcon, ImageIconId,
rgba_to_color_image) was in widgets/mod.rs of both bars with two small
differences: Windows has `Hwnd(isize)`, `SystrayIcon(String)` and `remove`,
macOS has `WindowId(u32)` and a private rgba_to_color_image. The core file
is the Windows one with the macOS variant and `From<u32>` added (an enum
with every variant, as D26 does for WidgetConfig); both bars re-export the
items from widgets/mod.rs so no widget changes. The core gains the `image`
dependency (one line in each Cargo.lock) and a Default impl for IconsCache
(clippy).
Verified: schema harness macOS and Windows byte-identical (3,774 / 9,091
lines); native bar-core tests 3+5; Windows clippy -D warnings --locked
clean; macOS fake-CC check --locked 0 errors (re-run after touching the core
files). Not run: the bars.
Every WindowsApi::window_rect(hwnd) in border_manager/mod.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: borders. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
Every WindowsApi::window_rect(hwnd) in process_command.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: commands, resize. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
Every WindowsApi::window_rect(hwnd) in animation/ghost_dispatcher.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: animation scenarios. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
KDE's Backend took and returned bare u32 ids and answered
window_workspace and current_workspaces without a Result. The operations
that the shared trait has now use komorebi_backend's WindowId and
MonitorId, window_workspace and current_workspaces return its Result, and
the look/drag/wallpaper methods that only KDE has take the same id types.
So the Shared wrapper no longer converts ids or results: it is down to
the window info mapping.
The window manager core keeps its u32 ids (Window { id: u32 }); the
conversion is at the backend call (Window::window_id, From<WindowId> for
Window, WindowId::from_u32 / to_u32 at the remaining call sites). KWin's
table stays keyed by u32; an id too wide for a u32 is a window it never
had (WindowGone, or None for a query). Test call sites got .into() on the
ids and unwrap on the two results. No behaviour change.
Verified: KDE cargo test --workspace --no-fail-fast (unit, integration,
doc) 881 passed, 0 failed, native with FakeBackend. Not run: KDE VM
suites.
Every WindowsApi::window_rect(hwnd) in scrolling.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: scrolling. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
Every WindowsApi::window_rect(hwnd) in pan.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: scrolling pan. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
Every WindowsApi::window_rect(hwnd) in live_resize.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: resize. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
Every WindowsApi::window_rect(hwnd) in animation/snapshot.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: animation scenarios, workspaces. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
Every WindowsApi::window_rect(hwnd) in stackbar_manager/stackbar.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: stacking. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
Every WindowsApi::window_rect(hwnd) in stackbar_manager/mod.rs becomes
backend().frame(WindowId::from_hwnd(hwnd)). WindowsBackend::frame is
Window::window_rect, i.e. the same DWM call with the Win32 error kept; the
callers' ?, ok(), unwrap_or_default() and is_ok_and() behave as before (only
the error text can differ: a window that died meanwhile reports WindowGone).
BEHAVIOUR: none intended; e2e gate needed: stacking, layouts. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
process_command (close and minimize of the foreground window, four raise
calls) and monitor_reconciliator (four minimize calls) now call
backend().close/minimize/raise. WindowsBackend runs Window::close,
minimize and raise unchanged (minimize still leaves komorebi-bar alone).
docs/dev/backend-switch.md now holds the full table of what is switched
and what is left, including why the queries (window_rect,
foreground_window, cursor_pos, monitors) were NOT switched: each would drop
an error that callers use or report, or fabricate a default.
BEHAVIOUR: a dead window is skipped by an IsWindow check first; minimize
results are ignored as before. e2e gate needed: commands, monitor
reconciliation (monitor_reconciliator), lifecycle. Verified: Windows clippy
-D warnings via tools/fast-check PASS; e2e not run.
The 23 window.hide() and window.restore() calls (container, workspace,
monitor, process_command, process_event, window_manager) become
let _ = backend().hide(..) / restore(..): WindowsBackend runs Window::hide
and Window::restore, so hiding behaviour (cloak, hide, minimize), border
and HIDDEN_HWNDS bookkeeping are the same. Not switched: hide_with_border
and restore_with_border (the shared trait has no border flag), the
animation transition and ghost dispatcher calls (they run inside the
slide-in machinery), minimize, close, raise and maximize (to follow).
BEHAVIOUR: a window that is already gone is skipped (IsWindow first), so it
is no longer added to HIDDEN_HWNDS or shown; the result is ignored as
before. e2e gate needed: commands, workspaces, stacking, lifecycle_hidden,
minimize/monitor scenarios. Verified: Windows clippy -D warnings via
tools/fast-check PASS; e2e not run.
The two Window::set_position(rect, false) call sites (the workspace
layout update in workspace.rs and the stackbar tab click) now call
backend().set_rect(..), which is Window::set_rect = set_position(rect,
false): the animation, slide-in and live-resize guards are the same.
Not switched: the top = true callers (window.rs move_to_area/center,
workspace.rs maximize area), since the shared set_rect has no top flag, and
all window_rect reads: the shared window_rect is built on window(id), which
asks title, class, exe and path of every window, returns None instead of the
Win32 error and defaults on failure; the 60 call sites rely on Err or
unwrap_or_default, so they stay on WindowsApi::window_rect until the trait
or the adapter has a cheap frame query.
BEHAVIOUR: a dead window fails early with Error::WindowGone, and one
extra IsWindow call per write. e2e gate needed: commands, resize, layouts,
stacking, scrolling, workspaces. Verified: Windows clippy -D warnings via
tools/fast-check PASS; e2e not run.
Switch the 40 Window::focus(mouse_follows)? call sites in process_event,
process_command, workspace, window_manager, focus_manager and the
stackbar click to backend().focus(WindowId::from_hwnd(..), mouse_follows).
WindowsBackend::focus runs Window::focus, so the deferral while a window
slides in, the already-foreground shortcut and the cursor centring are
unchanged. animation/transition.rs:534 stays on Window::focus (it is the
code Window::focus defers to). docs/dev/backend-switch.md records what is
switched.
BEHAVIOUR: a dead window now fails early with Error::WindowGone (before:
the Win32 error from raise_and_focus_window) and a failed focus of a window
that died meanwhile reports WindowGone; every caller uses ? or ignores the
result. e2e gate needed: commands, focus, focus_follows_mouse, stacking,
workspaces, lifecycle. Verified: Windows clippy -D warnings via
tools/fast-check PASS; e2e not run.
A static WindowsBackend behind backend() -> &'static dyn Backend, the way
KDE spells it. Nothing calls it yet; the next revisions switch call sites
one cluster at a time (docs/dev/backend-switch.md).
Not a behaviour change. Verified: Windows clippy -D warnings via
tools/fast-check PASS.
Windows call sites read the frame about 60 times and rely on the Win32
error (or unwrap_or_default). The shared window_rect is built on window(id),
which also asks title, class, exe and path and gives None for every failure.
Add the provided method Backend::frame(id) -> Result<Rect>: WindowGone for
an unknown window, Platform for a failed read. The default goes through
window() (a table lookup on KDE through Shared<B> and on the fake, so the
cached/requested-rect semantics of seam.md section 2 row 2 are kept);
WindowsBackend overrides it with Window::window_rect (one DWM call) and
MacosBackend with MacosApi::window_rect (the two Accessibility reads, no
metadata). The contract tests check frame agrees with window().rect and is
WindowGone for an unknown id; FakeBackend gets a test. A provided method, so
no adapter had to change to compile.
Not a behaviour change (nothing calls it yet). Verified: tools/fast-check
(native crate tests pass, Windows clippy -D warnings, KDE check + lib tests,
macOS fake-CC type-check) PASS; macOS cannot be run here.
docs/dev/bar-unification.md: why config.rs, bar.rs and komorebi.rs are not
moved yet, file by file with the measured difference (differing lines and
hunks), the structural blocker (two Cargo workspaces/lockfiles/flakes, two
komorebi-client crates), the schema views that settle schema.bar.json, the
ordered plan, KDE (no bar exists), the macOS commands that spawn cmd.exe or
explorer.exe and are preserved in os.rs, and what must be checked by hand on
Windows and on a Mac.
Verified: figures from diff on this tree; no code changed. Gates at this
tip: schema harness macOS and Windows byte-identical, native bar-core tests
3+5 passed, Windows clippy and macOS fake-CC check clean.
Pure move of the (now byte-identical) time.rs of both bars into
crates/komorebi-bar-core/src/widgets/time.rs; the only edit is the path of
Alignment. komorebi-bar-core gains the lazy_static dependency (TIME_RANGES);
Cargo.lock of the root and of komorebi-for-mac get that one line. Both bars
re-export the module. 541 lines per bar are gone.
Verified: schema harness: macOS byte-identical (3,774 lines), Windows
byte-identical (9,091 lines); native bar-core tests 3+5 passed; Windows
clippy -D warnings clean (--locked); macOS fake-CC check --locked 0 errors.
Not run: the bars.
The two time.rs differed in three lines: a `default = false` schema
attribute on changing_icon and the variant title "Default" for
TimeFormat::Custom (both only in the macOS file; the title is a macOS
mislabel), and `1.0` vs `1.0_f32` (same type). The macOS source now reads
as the Windows one; the macOS schema view (komorebi_bar_core::schema) sets
the macOS text back, so komorebi-for-mac/schema.bar.json and
nix/komorebi-bar-options.nix are unchanged. The two files are now
byte-identical.
Verified: schema harness: macOS byte-identical (3,774 lines), Windows
byte-identical (9,091 lines); Windows clippy -D warnings clean; macOS
fake-CC check 0 errors.
Pure move of the (now byte-identical) storage.rs of both bars into
crates/komorebi-bar-core/src/widgets/storage.rs; the only edit is the path
of Alignment (crate::bar::Alignment -> crate::alignment::Alignment). Both
bars re-export it (`pub use komorebi_bar_core::widgets::storage`), so no
other file changes. 207 lines per bar are gone.
Verified: schema harness: macOS byte-identical (3,774 lines), Windows
byte-identical (9,091 lines); native bar-core tests 3+5 passed; Windows
clippy -D warnings clean; macOS fake-CC check 0 errors. Not run: the bars.
Window already had focus, raise, hide, restore, minimize and close under
the names of the shared Backend trait (docs/dev/seam.md section 2). Add
the four that were missing as thin delegates: set_rect (set_position with
top = false), alive (is_window), window_rect (WindowsApi::window_rect) and
unminimize (WindowsApi::restore_window). No call site changes; the
unused-by-the-daemon WindowsBackend now calls the new names.
Not a behaviour change. Verified: Windows clippy -D warnings via
tools/fast-check PASS.
window_is_eligible (window.rs) took regex, ignore, manage, floating, then
layered, no-titlebar and slow; apply_globals (static_config.rs) took
ignore, regex, manage and the rest in yet another order: a rule check and
a config load could wait for each other for ever (the KDE tree hit this,
see ef1d3ef0 there).
One order is now documented at the statics in lib.rs: floating, session
floating, transparency, ignore, manage, layered, tray, object-name-change
(two), slow, no-titlebar, workspace rules, regex (a leaf: every rule check
takes its list and then the regexes). window_is_eligible takes the lists it
reads up front in that order and, once it has matched them all, drops every
guard BEFORE the slow-application sleep (before this, the sleep ran with
the regex, ignore, manage, floating, layered and no-titlebar guards held, so
a config load or rule command waited out the compensation time); apply_globals
is reordered. Every other site that nests two of these (state.rs,
process_command.rs session float rules, process_event.rs,
window_manager_event.rs, transparency_manager.rs, window_manager.rs,
workspace.rs) already followed the order.
BEHAVIOUR: lock acquisition order and hold time only; no rule semantics
change. Gate needed: Windows e2e commands and config_reload. Verified: not
yet re-run after the guard-drop change.
The two storage.rs differed in the click handler and in four doc strings.
The click now asks the platform (new SystemTool::StorageLocation(label)) and
each shell keeps exactly what it spawned: Windows `cmd.exe /C explorer.exe
<first word of the label>`, macOS `open <label without its last word>`. The
macOS doc strings take the Windows spelling (C:\, Local Disk); the macOS
schema view sets the macOS text back, so komorebi-for-mac/schema.bar.json
and nix/komorebi-bar-options.nix do not change.
Verified: schema harness S/bar2/regen.sh: macOS byte-identical (3,774
lines), Windows byte-identical (9,091 lines); the two storage.rs are now
byte-identical to each other; Windows clippy -D warnings clean; macOS
fake-CC check 0 errors. No click was exercised (cannot here).
Adds the three BEHAVIOUR-relevant registry revisions (registration and
forgetting, native-tab sync) with what to look for on a Mac, the mechanical
ones to section B, and a status entry in the bug list saying what of step
11(ii) is done and what is deliberately not (animator lanes, borders,
reaper/live-resize timeouts, the model holding bare ids).
Verified: documentation only.
Step 11(ii), fifth part. window_manager.rs cloned the dragged window's
element out of the workspace only to call MacosApi::window_rect on it; it
now asks the Window found in the container for window_rect (the same call on
the same element). One raw AX site fewer outside Window. The error is the
same one the old call returned, still propagated with ?. Not behaviour.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run on Linux.
Step 11(ii), fourth part. The seven sites that derive a CGWindowID from an
element that the system handed over (event tap, observer callbacks, the
focused window of an app, the tab check) call ax_registry::identify instead
of AccessibilityApi::window_id: input_event_listener.rs, process_command.rs,
process_event.rs (5), window_manager.rs. It is the same call; the point is
that an element becomes an id only here, which is the key the registry is
filled under. Not behaviour: nothing changes at runtime.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run on Linux.
Step 11(ii), third part. BEHAVIOUR (bookkeeping only). The two places in
process_event.rs that swap a window's id and element in place when a native
tabbed application shows another tab now call ax_registry::sync(old_id,
window): the old id is forgotten and the window registered as it now is, so
the table never names an element that the model has replaced. No AX call is
added.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run on Linux. Gate needed: Mac hand check with a tabbed app
(Terminal or Finder tabs; see docs/dev/macos-handcheck.md): switch tabs,
close the first tab, focus the window by command; behaviour must match the
baseline.
Step 11(ii), second part. BEHAVIOUR (memory and bookkeeping only; no AX call
is added anywhere, and no existing call reads the table yet except the
still-unused MacosBackend).
Window::new registers the window under its id. Entries end where the daemon
learns of a death: Window::drop when the window is no longer alive (next to
the InvalidWindow notification it already sends), reap_window in the reaper,
and WindowManagerEvent::Destroy for NSWorkspaceDidTerminateApplication
(forget_pid, next to enhanced_ui::forget: a new process may reuse the pid).
A live window that is never managed stays registered until it dies or its
application quits; the table holds retained references that the Window clones
held anyway. The native tab case (id and element changed in place) follows in
its own revision.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run on Linux. Gate needed: the Mac hand check, see
docs/dev/macos-handcheck.md (open and close many windows and quit apps; the
daemon's memory must not grow; nothing else should look different).
Step 11(ii), first part. New module ax_registry.rs instantiates
komorebi_backend::Registry (rules tested natively in 4c9094d7) with AxEntry
{element, observer, application with its pid}; lifetime and thread rules are
written at the top of the file: entries end on Window::drop of a dead window,
reaper reaping and application termination (wired in the next revisions);
nothing in it dispatches to main or takes the WM lock; removed entries are
dropped after the table's lock is released. Window gets entry() and
from_entry() to convert. MacosBackend drops its private HashMap<u32, Window>
and looks windows up here (register and forget delegate), so the compile-only
adapter now resolves an id the same way the daemon will.
BEHAVIOUR: none yet, nothing registers (the adapter is still unused by the
daemon). Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not
verified: cannot run on Linux.
KDE's Backend trait returned eyre reports and the Shared wrapper turned
them into komorebi_backend::Error (guessing WindowGone from is_window
afterwards). The 16 operations that the shared trait has now return
komorebi_backend::Result themselves: KWinBackend says WindowGone for an
id it has no uuid for and Platform for everything else, and the fake
passes the shared fake's errors through. Window's commands (set_position,
focus, raise, close, minimize, ...) return the shared Result too. KDE-only
methods (look, border colours, wallpaper) keep eyre.
Only the text of a failure changes ("no such window: 9" instead of
"there is no such window" in logs); no control flow does.
Verified: KDE cargo test --workspace --no-fail-fast, 881 passed, 0 failed
(native, FakeBackend). Not run: KDE VM suites.
Both bars now print `schema.bar.json` as the view of the generated union
schema (komorebi_bar_core::schema::generated_text): Windows through the
Windows view (the identity), macOS through the macOS view. The sources of
both bars are still separate, so the generated text is what it was and the
macOS changes set what is already there (they are idempotent); this is the
switch that lets the next revisions move code that differs only in schema
text into the core in the Windows spelling.
Verified: out-of-tree schema harness (S/bar2/regen.sh, real sources, bins
updated to call generated_text): macOS byte-identical to
komorebi-for-mac/schema.bar.json (3,774 lines), Windows byte-identical to
schema.bar.json (9,091 lines). Native bar-core tests 3+5 passed, Windows
clippy -D warnings clean, macOS fake-CC check 0 errors. The binaries were
not run (cannot on Linux).
Step 11(ii), the pure part. macOS cannot act on a window from its id: it
needs the Accessibility element, the pid and the observer. Registry<H> is
that table, generic over the handle so that its rules run on any host.
Rules, written at the top of registry.rs and tested: thread-safe; a
lookup clones the handle and releases the lock before anything is done to
it; a removed or replaced handle is handed back to the caller instead of
being dropped under the lock (dropping a macOS handle can make an AX round
trip, which must never happen with a lock held: seam.md 3.3); a stale or
unknown id is Error::WindowGone, never a panic; an entry ends on remove,
remove_pid (application quit) or a failed call; re-inserting replaces.
Nothing uses it yet; no daemon changes.
Verified: native cargo test -p komorebi-backend: 38 unit (9 new) + 7 doc
(1 new) + 1 compile_fail passed, 0 failed. Not run: the Windows, KDE and macOS
checks (the new module is std-only and no other file changed).
Lists what must be checked on a Mac once the unified binaries exist: every
macOS revision that changes runtime behaviour (the rule-list lock order,
the shared command listener, pause filter, subscriber push, EventChannel,
SocketMessage, animation prefix, StaticConfig, komorebic launcher, bar-core
hooks and library bumps), the mechanical Step 6/11(i) revisions of this
stack, the walk-through the plan names (focus, move, stack, workspaces,
scrolling, pan, borders, animations, display change, sleep and wake), and
the bugs noticed: the main-queue/WM-lock deadlock of seam.md 3.3, cmd.exe
and explorer.exe in the macOS bar, the update widget's wrong repo, the raw
AX sites that remain outside Window.
Nothing in it was run: macOS cannot be built or tested on this host.
Verified: documentation only.
Renames Window::frame (added two revisions back) to Window::window_rect and
its 28 callers: Backend::window_rect is the shared name, and the Windows Window
got the same one (wip-u-kfw mkwoqsvs). Same body; nothing changes at runtime.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
Step 11(i). The compile-only adapter still read the Accessibility element
for two things: the minimized flag (copy_attribute_value of kAXMinimized)
and close (AdhocWindow::close on the element). Window::minimized is added
(the same query, on self.element) and the adapter now calls it and
Window::close; with set_rect, focus, raise, hide, restore, minimize,
unminimize, alive and frame (earlier revisions) every operation of the
adapter is a Window method and the file imports no AccessibilityApi. The
adapter is still not used by the daemon, so nothing changes at runtime.
Steps 11(ii) (id registry) and (iii) are not started.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
Adds Window::close (Backend::close): the same press of the close button
that AdhocWindow::close does on a bare element, applied to the Window's
element. Nothing calls it yet; MacosBackend switches to it in the next
step. No behaviour change: the daemon's own close command still goes through
AdhocWindow on the foreground element, because it has no Window there.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
The Windows schema.bar.json is the union of the bar configuration (every
widget, the mouse options, Windows spelling). New module `schema` holds the
macOS view as data: 16 changes (set text/defaults that read differently,
remove the mouse property, the Keyboard/Media/Systray widget variants and
the NetworkConfig default_interface_options) followed by pruning of the
definitions nothing refers to any more. Same design as komorebi-config
(schema.rs, changes.rs); the changes are idempotent so a bar can print its
own generated schema through its view.
Nothing uses the views yet; no bar source changed.
Verified: native `cargo test -p komorebi-bar-core` 3 unit + 5 oracle passed
(new: the macOS view of the checked-in Windows file is byte-identical to
komorebi-for-mac/schema.bar.json; the Windows view is the Windows file; a
view is idempotent). Windows clippy -D warnings clean; macOS fake-CC check
0 errors. Not verified: nothing rendered.
Adds Window::set_messaging_timeout and uses it in settle.rs (the look at a
window after a drag, 3 raw AX sites) and in Window::note_arrival. Same call
on the same element; nothing changes at runtime. It is not one of the
shared Backend operations, but it bounds the frame query, so the raw AX
call leaves settle.rs with the frame read. The window manager's timeouts
list and the animator keep calling AccessibilityApi: they hold elements
(app elements, lane handles), not Windows.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
Renames Window::set_position(&Rect) to Window::set_rect (window.rs and its 9
callers in workspace.rs, window_manager.rs, scrolling.rs, settle.rs and
macos_backend.rs). Body untouched: the direct path (set_point, set_size) or
the animator, as before; nothing changes at runtime. The animator's own free
function set_position, set_point and set_size stay as they are (they are the
AX writes, not the Window operation).
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
Renames Window::is_valid to Window::alive (window.rs, reaper.rs,
workspace.rs, macos_backend.rs). Same body (the element still answers a
copy-attribute-names query), so nothing changes at runtime. Application::is_valid
is a different type and keeps its name. This is the 'alive' operation of the
step 6 list.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
Adds Window::frame(), the frame query (Backend::window_rect), and routes
the 28 sites that read a Window's frame through MacosApi::window_rect(&w.element)
(window.rs, window_manager.rs, workspace.rs, process_event.rs,
process_command.rs, settle.rs, macos_backend.rs) through it. frame() is the
same call on the same element, so nothing changes at runtime. Sites that hold
a bare element rather than a Window (tabs in process_event.rs, borders,
the animator, AdhocWindow) are left as they are.
Step 6 of the consolidation, macOS, one operation per revision.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run or unit-test on Linux.
BEHAVIOUR (lock order only). window.rs (should_manage rule check) took the
regex list, then ignore, then manage, then floating; static_config.rs
(apply_globals) took ignore, regex, manage, floating. Two threads, one
checking a window and one loading the config, could each hold what the
other waits for. Same defect as the KDE fix ef1d3ef0; the order is now the
KDE one minus the lists macOS lacks: floating, (session floating),
ignore, manage, (workspace rules), regex. Both sites acquire in that order
and the order is documented at the statics in lib.rs. The other holders
(process_event.rs floating -> regex, process_command.rs floating ->
session floating, window_manager.rs workspace rules -> regex) already
follow it; every other site takes a single rule list.
Verified: macOS fake-CC type-check (tools/fast-check) PASS. Not verified:
cannot run on Linux; a deadlock is not reproducible by reading anyway. Gate
needed: none runnable here; hand check on a Mac (docs/dev/macos-handcheck.md):
reload the config while windows open/close.
Regenerated komorebi-for-kde/nix/komorebi-options.nix from schema.json with schemars-nixgen (50ce286: sorted output, hash first line) and nix fmt. The checked-in file was stale after steps 2 and 3 changed description lines in the schema. Verified: nix build of kfde-schema-fresh and kfde-nix-options-validation from the root flake both succeed.
Regenerated komorebi-options.nix and komorebi-bar-options.nix from schema.json and schema.bar.json with schemars-nixgen (50ce286: sorted output, hash first line), then nix fmt from the root flake's formatter because the macOS flake has none on Linux. The generator was not run from the macOS tree's own just recipe. Verified: not built or evaluated on macOS; the macOS flake has no schema-fresh check, so the hash line is informational.
schemars-nixgen now writes the `# schema-sha256:` first line itself (schemars-nixgen 50ce286), so the justfile's printf and mv step would add a second one. Removes them and updates the comment. Verified: 'just nixgen' itself was not run (the recipe also builds a check); the same steps by hand gave a first line equal to `nix hash file --type sha256 --base16 schema.json`.
Consumers that check whether generated options are older than their schema
(komorebi-for-kde's `schema-fresh`) compare a `# schema-sha256: <hex>` first
line with the hash of schema.json. That line was added by hand in the
consumer's justfile with `printf` and `nix hash file`, so the tool's own output
could never pass the check.
Write the line from the tool. `schema_hash_header` returns it for the raw bytes
of the schema file, in lowercase hex, which is the digest `nix hash file --type
sha256 --base16` prints. The binary puts it before the generated code; the
library functions that return generated code are unchanged, so library users get
no new line unless they ask for it.
Adds the sha2 dependency.
Verified: cargo test passes (49, including two known SHA-256 vectors). On the
komorebi-for-kde schema.json the first line equals `nix hash file --type sha256
--base16 schema.json`.
The generator kept its definitions, reference counts and type bindings in
HashMap and HashSet, whose iteration order changes from run to run. The
topological sort walked the keys in that order, so which shared types were
bound before their dependents, and so how some types were written out,
changed between runs. Running the same schema eight times gave eight
different files.
Use BTreeMap and BTreeSet in generator.rs and prepare.rs so every walk is in
sorted key order. The final let block was already sorted by identifier and is
unchanged.
Verified: cargo test passes (48 tests). Running the release binary on the KDE
schema.json eight times gave one identical output; the same eight runs before
the change gave eight different outputs.
The doc of Backend::focus said Windows and macOS do focus and then center_cursor_in; writing the adapters showed that Window::focus on both takes mouse_follows_focus and centres the pointer itself (Windows also defers the focus while the window slides in). Doc comment only.
Verified: see the gates below; native cargo test -p komorebi-backend passes (doctests unchanged).