Skip to content

v0.1.2

Choose a tag to compare

@github-actions github-actions released this 16 Oct 22:19
· 311 commits to main since this release
v0.1.2
c211261

Added

  • shared = "required" in the policy file, or NIRI_COMPUTER_USE_SHARED=required, makes the shared engine required, so every client of a niri instance is served by one process, with one crash guardian, niri event stream, accessibility connection and audit writer. A server that can't reach the engine, or that the engine refuses, no longer serves its client on its own: it lists the client's tools, every call fails with engine_unavailable, and the detail and the server's stderr say why, such as the engine's socket path and the connect error, or the refusal. Restart the server once the cause is fixed. A wrong NIRI_COMPUTER_USE_SHARED doesn't drop a requirement the file sets, and neither does a mistake elsewhere in the file, even one that stops it parsing as TOML. status.shared reports the setting (on, off or required) and why the variable was refused. The default, true, still falls back to serving the client on its own.
  • wait_for waits on a window's accessible elements: {"element": {"window_id", "role", "name_contains", "state", "absent"}} waits until an element elements would list, with that role, name text and state (a name from a JSON listing's states, or disabled for one without sensitive), is there, or with absent: true until none is. A met wait for an element that appeared returns its element_ref while you hold the lease, with unbound or unmappable when elements would give them, and no ref, with the reason in detail, when a walk cut short can't tell it from a look-alike further on. A window that closes ends the wait as window_gone, and one whose app isn't on the accessibility bus as not_accessible. A walk cut short, or one that skipped an object gone by the time it read it, and with it everything under it, never counts as proof that the element is gone, and a wait that times out after such a walk says which in detail. A walk that the wait's own end cut short, one that began with less than its three-second budget of the wait left, doesn't count against the walk before it, so a wait whose earlier walks read the whole tree doesn't time out saying the last walk was cut short. A walk that began earlier and ran out of its own budget still says so, even when it came back after the wait's end. The audit log keeps the role and state names and the length of name_contains, never the text.
  • activate_element and set_element_text return effect: seen when reading the element back showed the action's effect, differs when a field holds other text than was sent, none_seen when nothing the server can read changed, and unverified when it couldn't be read. A read that fails after the action went out is unverified with the reason in detail, never an error. The audit log keeps effect beside observed.
  • activate_element reads the value of an element that has one, such as a slider or spin button, before and after, and says in element.value_changed whether it changed, never the value. It also compares the element's name, and says in element.name_changed whether a button relabelled itself, never either name.
  • When elements, wait_for's element condition or an action's element_changes finds the window of a Chromium, Electron or CEF app off the accessibility bus and the session's accessibility is off, the server turns it on by registering an AT-SPI event listener, as a screen reader does, and holds it on until the server ends, however it ends. Chromium, Electron and CEF apps join the bus only when it was on when they started, so apps started after that are listed; one already running needs a restart, and not_accessible's detail says to ask the user first. The server tells such an app by the files Chromium maps (icudtl.dat or v8_context_snapshot.bin in /proc/<pid>/maps); for any other app off the bus, such as a terminal, or a process it can't inspect, it changes nothing and gives the plain not_accessible. The server never writes org.a11y.Status, leaves accessibility alone when something else turned it on, and needs at-spi2-core 2.61 or later: with an older one it lets go and says so. turn_on_accessibility = false in the policy file turns this off. status.accessibility_switch says what the server did (off, on, turning_on, unsupported, or let_go once accessibility read off while the server's listener held it on, which two overlapping calls don't cause), and status.policy.turn_on_accessibility whether it may. The launcher also sets GSettings' toolkit-accessibility to true, as it does when a screen reader starts, and that stays after the server ends; gsettings reset org.gnome.desktop.interface toolkit-accessibility undoes it.
  • elements asks a Chromium window for its page's tree when it shows none, as Chromium builds it only once an assistive technology asks. That listing has building: true, or the app built its tree just now in the compact header: list again a second later for the page.

Changed

  • set_element_text on an editable field that has no EditableText interface, as Chromium's text fields are, fails with text_not_settable instead of a plain invalid arguments: that read as a mistake to fix and send again. Its detail says to focus the field with activate_element, then send the text with type_text, pressing ctrl+a with key first to replace what it holds. A password field without EditableText is secret_field, and an element that isn't editable is still an argument mistake.
  • A shared engine that refuses a client's server because it runs another build says what to do. After an upgrade, a client still running the old build whose engine ended meets an engine of the new build, which refuses it for as long as it runs: its engine_unavailable detail now names both builds and says to restart that MCP client, where it said only that the engine runs another build, and the bridge no longer adds that the next call tries again. An engine whose own file was replaced since it started says to restart the clients it serves. When neither file was replaced, as with two installs on different paths, where restarting either client runs its build again, it names both files and says to point the clients at one. Bridges name their release in the hello, which engines of 0.1.1 and older ignore.
  • A client started after an upgrade beside a shared engine of 0.1.1 or older, which it is served standalone beside, says in status.engine.fallback that engine's PID and what to do, from the files that engine and this server were started from: when an upgrade replaced the engine's file, that it serves the clients started before the upgrade until the last of them ends, and to restart those clients to end it; when both builds are still installed, to point the clients at one file. That engine's own words say only that it runs another build, or, from 0.1.0, the bridge speaks hello Some(3); this engine speaks 2. Engines now name their release in a refusal, so a bridge adds this only to an older engine's.
  • elements reads the elements inside a container of more than 64 children, such as a long list, table or grid, after the rest of the window, and lists them after it. A window whose walk is cut short inside such a list still lists its own controls, such as the toolbar's and the buttons below the list, where it used to stop before them; those outside a named list row are unbound: cut_short, since the unread part may hold a look-alike.
  • elements reads up to 20,000 objects of a window's tree, up from 2,000. One long list, table or grid used to stop the walk before the rest of the window, so its other controls were never listed, or were unbound: cut_short. In nested GTK 3, GTK 4 and Chromium windows of 2,218 to 15,022 objects, the whole tree now reads in 0.15 to 0.82 s and every control outside the list has a bound ref; listing such a window takes that long. A window over 20,000 objects, or too slow to read in the three seconds, is still cut short.
  • type_text refuses text, typed or pasted, that ends with tool-call closing tags such as </parameter> or </invoke> that no opening tag earlier in the text balances, each opening tag balancing one closing tag, with leaked_tag and the tags named in detail. Models sometimes leak their own tool-call markup into the end of a long argument. Nothing is typed or pasted; send the text again without the tags.
  • set_element_text reads the field's text back and compares it with the text sent, instead of comparing only the character count. A field that reformats or masks text without changing its length is now differs, not matched. Neither text is returned or logged.

Fixed

  • A pointer tool no longer fails with lock_stale before its first input, or stops partway with its button released, when nothing was slow. Each look in a gesture kept a lock read under 250 ms old and then required it to be under 250 ms old at its end, so a read that turned 250 ms during the look itself stopped the gesture. Such a look now reads the lock state again and looks once more. A gesture still stops when that second look is too slow.
  • A pointer tool aimed at pixels of a screenshot no longer goes out after the windows on that output moved since the capture. The ref was checked only against its age and its output, so two clicks 5 and 12 seconds after their screenshots pressed wherever the screen had moved to: in a real session, the user resized the browser and later focused their terminal beside it, and the agent's clicks went to the browser's blank margin and into the terminal. The call now fails with ref_invalid and layout_changed when the overview, the output's workspace, a window on it opening, closing, moving or resizing, or the window niri scrolls the view to changed after the capture began, even if the change was undone since, and says which. niri's initial state counts as a change on every output, both when the server starts reading niri's events, since niri may be moving windows then, and when the event stream reconnects, since niri may have moved windows while it was down. It checks when the call starts and again right before the first input and, for a drag, before the press, so with niri's focus-follows-mouse on, a drag that starts over a window without focus stops before the press as uncertain: its own motion focused the window, which may scroll the view. A drag from a new screenshot then goes through. A reconnect of the event stream while the call gets ready fails it with unknown_ref, as at its start. niri doesn't report everything that moves what is under a pixel, so the check can't see the view scroll with nothing else changing, as with center-column, a floating window raised over another, a layer-shell surface such as a notification opening over the target, or a change inside a window. A change less than a second before the capture counts too, since niri may still have been animating it and the image may show windows on their way, unless the screenshot waited for the screen to settle and it stopped changing after the change, as screenshot: true on an action does; that refusal's detail names those settled screenshots, since a plain one taken right away is refused again. So in the server's first second a plain screenshot can't be aimed at by pixel, while a settled one can, and an aim at an element is refused by its own check as not_showing, since the view may still be moving. An aim at an element is otherwise placed again just before the gesture and isn't affected by this check.
  • A wait for the screen to settle, wait_for with screen_stable or an action's screenshot: true, no longer pushes the agent's screenshot refs out. Each capture it took kept a ref, about ten a second, and a lease keeps 64, so in a real session a 25-second wait_for on a screen that never settled, with the agent's own terminal spinner on it, dropped the screenshot the agent had just looked at, and its zoom failed with unknown_ref. Only the capture the wait returns keeps a ref now, so a settle wait pushes out at most one of the agent's 64, and a wait that returns no screenshot none.
  • key and type_text, typed or pasted, no longer answer sent when niri moved keyboard focus to another window in the last moments of the call. niri sends keys to the window it has just focused before its event stream reports the move, and the check before each key reads that stream, so a move near the end went unseen: in a nested run, niri sent a key to a modal dialog's own surface and the call answered sent with focus: matched. After the last key the server now asks niri which window has focus, and reads the events its stream has passed on by then; focus elsewhere makes the call interrupted, and no answer from niri makes it uncertain. It also asks niri before the submitting Return and before the last key of a key call, such as the Return of ["Down", "Down", "Return"], and sends nothing more when focus moved, by niri's answer or by what its event stream reported while niri answered, so Return doesn't confirm a dialog that just took focus. When niri answers so slowly that the lock state's last read is over 250 ms old by then, the server reads the lock state again and asks niri once more, rather than failing that key with lock_stale after the others went out. An interrupted call whose keys went out says in detail how many and that some of them may have reached the window that took focus. An app that hands keys to a dialog of its own before niri has focused it, as GTK does with a modal dialog, still gets sent: niri sent the keys to the window expect named, and only changes shows the dialog opening and taking focus afterwards.
  • A Chromium page's elements no longer get a layout_box in the output's pixels. With prefer-no-csd in niri's config, Chromium's frame is the window's size, so its elements were placed, but Chromium gives a web page's coordinates in the output's pixels: at scale 1.5 a field at 106,106.7 200×29.3 was listed at 126,126 300×45, and a click by its ref landed below it. The server now divides a page's coordinates by the output's scale when the page's document is the size of the view holding it times that scale, and checks that again right before a pointer tool aims. When the document matches neither unit, the element is unmappable: page_scale_unknown, and an element whose centre is outside its page's document, as under the browser's toolbar once the page is scrolled, is not_showing. The off-page refusal applies at every scale, scale 1 included; nothing else changes at scale 1, or with Chromium's own title bar and shadow, which still give frame_size_mismatch.
  • A screencast event the server can't parse no longer stops its event stream. niri built from main after 26.04 reports each grim capture, including the server's own screenshots, as a screencast of a kind niri-ipc 26.4.0 doesn't know. The server stopped its stream at the first screenshot and was read-only until it restarted; it now drops screencast events unread, as it never reads screencasts. Any other event it can't parse is handled as before: the first makes it reconnect, a second stops the stream.
  • An event that niri-ipc's state panics on, such as niri closing a window it never reported, now stops the event stream for good as schema_incompatible, so actions are refused with read_only and desktop_state and wait_for fail with upstream_error and the panic's message. The panic used to end the stream's reader without a word: status kept saying connected while the state stopped changing, and actions went on with it.
  • The input-dirty marker 0.1.0 writes while wtype runs is read again, as a running marker naming its input child, where 0.1.1 read it as unreadable. A server beside a 0.1.0 server still typing says that server's input may still be finishing, as for any other server's marker, and recover ends the wtype child the marker names, if it is still that process, and then sends zero modifiers from a fresh virtual keyboard, since a physical key doesn't always release a modifier wtype pressed, or says it couldn't, before it asks for the manual check. 0.1.1's recover cleared the marker and left the child running: in a nested 0.1.0 engine killed mid-type_text, its wtype child still ran when recover cleared the marker. recover never takes PID 1, init, for that child. It opens a pidfd for the child before it checks the child's start time and kills the child only through it, never its process group: 0.1.0 ran wtype itself, which starts no processes, so ending it ends the typing, and a process that took the child's PID after the check is never ended.
  • A paste's key no longer goes out to a window that took focus while the clipboard keeper admitted it. expect, focus and the deny list were checked before the server asked the keeper to admit the key, which can take up to half a second, and not again after, so the key could reach the window the user focused meanwhile, even one of an app the deny list names. Once the keeper admits the key, the server now checks again right before it: it reads the lock state again if its last read began more than 250 ms ago, reads the events niri reported meanwhile and asks niri itself which window has focus, since niri can send a key to a window it has just focused before its event stream says so. Focus or the keyboard layout moving ends the call interrupted with pressed: 0, a denied app fails it with app_denied, and a locked screen or a stop fails it as before any key. Either way the key isn't sent and the clipboard is put back.
  • An action's element_changes no longer reports elements as removed when an object went away while the walk after the action read the tree: the walk skipped that object and everything under it, so their elements looked gone, though a replacement may still hold them. It now says unknown: nodes_gone.
  • elements no longer fails on a window with an object of more children than the app will list, as GTK 3 apps refuse to list more than 65,536 with InvalidArgs, such as a tree view of 22,000 rows of three columns. The walk reads on past that object, and the listing is cut short with capped_reason: children_refused, so the window's controls outside named rows are listed unbound: cut_short. An action's element_changes for such a window says unknown: children_refused.
  • elements no longer binds a ref by a count of look-alike elements it didn't finish. A control outside any list row whose twin, with the same role and name, lay past the listing's limit got a ref that could act on the wrong record, as with two Delete buttons of a list put on the bus without rows. The walk now reads on past limit to the end of the window's tree, so such a control is unbound: repeated. When the walk still didn't read the whole tree, cut short at its 2,000 objects or its three seconds, or because part of the tree went away while it read, a control in no row is unbound: cut_short, and every tool refuses its ref: aim at its pixels. In a window that large, only elements in a named list row keep a ref that acts. A listing now reads the whole tree whatever its limit and filters: about 55 ms for 600 objects and 190 ms at the cap in a nested GTK 4 window, where a listing that stopped at its limit took 2 to 13 ms.
  • A screenshot or element ref spelled with a sign or leading zeros in its number, such as shot-<tag>-+1 or shot-<tag>-01, no longer names the ref issued as shot-<tag>-1. Such a ref worked while the audit log recorded it as invalid_ref; it is now unknown_ref or element_stale, as any ref the server didn't issue.