Commit Graph
10 Commits
Author SHA1 Message Date
iris 23376aef25 Say what these do without naming what calls them
A doc comment that describes another function goes stale when that
function changes, and nobody editing it looks here.
2026-09-13 21:37:21 -04:00
iris 36fec09d11 Track who is hovered, apart from what consumes
Hover was per-sensor state that only changed when the walk reached that
sensor, so ending it depended on the walk, which consumption cuts short.
`CursorSenses` now keeps the set of widgets the cursor was inside, in a
new `Event::Global` slot for state a whole event type owns rather than
each widget -- which is also where the input restructure keeps its pointer
capture.

The walk visits only widgets the cursor is inside and stops at the layer
that consumes, as before. Whoever was in the set and is not now has been
left or covered, and gets its `HoverEnd` afterwards, however early the
walk stopped.

Two things fall out. `SensorState` is gone: whether a hover is starting,
on or ending is the difference between the two sets. And the consumption
line loses its `&& in_shape`, since being inside is now the reason the
widget is looked at rather than something to test again.

Nine tests, five of which fail on `main`. `hover_starts_and_ends_once_each`
pins the lifecycle, and `covering_a_widget_ends_its_hover` now returns the
cursor so an uncovered widget hovers again.
2026-09-13 21:34:01 -04:00
iris 827d317f41 Report consumption from run_event
`Event::consumes` says whether having run uses up what triggered it,
defaulting to no. `run_fn` already calls `should_run` per registration,
so it ors that across everything that ran and hands it back through
`run_event`. `CursorSenses` answers it with the sense it matched: a press
or a scroll is used up, hovering is not.

That drops `TypeEventManager::registered` and the second pass over a
widget's senses -- the match that decides consumption is now the same one
that decides whether the handler runs.

A cursor that is only resting still stops at the layer it is over, which
`run_event` cannot report because nothing need answer for it to be true.
It must not stop at a widget it has merely left, though, or ending a hover
above blocks the hover below: `leaving_a_widget_does_not_block_the_layer_below`
is that case, and it fails on `main` too.
2026-09-13 20:53:34 -04:00
iris 06dd015092 finished moving out render_state 2026-01-19 18:00:24 -05:00
iris f2ac6f195f remove typed stuff / just specify rsc if needed 2026-01-03 18:06:05 -05:00
iris 5da1e9e767 separate state from rsc 2026-01-01 22:18:08 -05:00
iris bae17235c6 better global state structure? 2025-12-19 21:54:48 -05:00
iris 30bc55c78e remove state generic from a lot of things 2025-12-17 21:37:55 -05:00
iris 0b8a93c5ce RE ADD CONTEXT 2025-12-15 21:50:53 -05:00
iris 9d8ca8fa72 refactor events 2025-12-12 02:02:54 -05:00