Repository navigation
feat(tooling): the tree dump says where the pointer is and which cursor it shows - #2117
Merged
Merged
Conversation
CSS help and progress: the arrow with a question mark and the arrow with a busy mark. winit has both (IDC_HELP and IDC_APPSTARTING on Windows, the theme's cursors on Linux, the CSS cursors on the web); on macOS the private AppKit selectors winit uses, behind respondsToSelector, else the arrow.
…or it shows A top-level pointer object (at, cursor) and a cursor field on the one element the shape is read from, by CSS name. Runtime::cursor's choice of that element moves into cursor_origin, which cursor_path shares.
This was referenced Nov 25, 2026
Hona
marked this pull request as ready for review
November 25, 2026 05:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2116 (
css_namenames every variant, so the two land in order).Compiled
Compiled on Windows x64, Windows arm64, macOS and Linux x64 in anomalyco/opencode-rune#1137, all four build jobs green: the app with Rune pinned to a check commit, the rev the app pins today (
4d8df909) plus this change and the five other cursor changes, cherry-picked. That is this change on the app's rev, not on this branch's base (devis 117 commits past it); everymatchonCursorthatdevhas was checked by reading.Run
On that build (Windows x64), 37 stops in a real window (a session, its tool rows, Settings): the tree's
pointer.cursorread headless, one run per stop, beside the cursor the window's own thread set. They agree at all 37:defaultwith the arrow (29),textwith the I-beam (6),pointerwith the hand (1),not-allowedwith the no-entry cursor (1). The element that carriescursoris the stop's own element, or the pressable row it sits in.Why
A headless run could not read the cursor:
--treewrote every element's rect, role and paint, but not the pointer's shape. The only way to check a cursor was a real window and the OS cursor its thread set. A pin bump's walk, or an app's own check that a control shows the arrow, needs this without a window.What changes
--tree(and a hot snapshot's JSON, which is the same dump) gains two things:pointer, at the top level, once the pointer has been somewhere:{ "at": [x, y], "cursor": "<name>" }.cursorisRuntime::cursor()by its CSS name:default,pointer,text,grab,grabbing,not-allowed,move,col-resize,row-resize,ew-resize,ns-resize,nwse-resize,nesw-resize,crosshair,cell,zoom-in,zoom-out,help,progress,none(Cursor::Hidden),image(an app's own picture).cursoron one element: the one the shape is read from. That is the pressed element while a gesture holds the pointer (the text that holds the selection while a drag selects), else the hit target under the pointer.What an element with no cursor of its own reports: the nearest ancestor's cursor, else
default. It is the value the shell shows, not the element's own setting. No other element carries the field. Outside the window, over no element, and while a middle-click autoscroll pans, no element carries it;pointer.cursorstill says what shows (default, orimagefor the pan picture).Runtime::cursor's choice of that element moves intocursor_origin, shared with the newcursor_path. Its result is unchanged.What it can change for an app
Nothing an app draws. A tool that reads
--treeand rejects unknown keys would seepointerand, on one element,cursor.Not run
The new test has not been run: this repo's tests run on the scheduled macOS job, which I read after the merge.
tree_json_reports_the_pointer_and_the_cursor_on_the_element_it_is_read_fromcovers: nopointerbefore a move, a handle with its own cursor, and a pressable element with none (default).