Skip to content

v0.7: mouse press/release/move bubbling + secondary-window input parity#174

Merged
tettou771 merged 3 commits into
mainfrom
dev
Jul 16, 2026
Merged

v0.7: mouse press/release/move bubbling + secondary-window input parity#174
tettou771 merged 3 commits into
mainfrom
dev

Conversation

@tettou771

Copy link
Copy Markdown
Collaborator

Mouse event bubbling (v0.7)

press / release / move now bubble from the front-most hit node up the parent chain until a handler consumes the event (returns true) — the same propagation scroll has always had. The first press consumer becomes the grab target: it owns the drag and the matching release.

  • RectNode's default handlers still consume, so existing UIs behave identically. Return false from onMousePress (etc.) to let ancestors see the event.
  • Secondary windows now dispatch move/drag/scroll/key events to their node tree and honor consumed, matching the main window. Previously only press/release reached the tree (ungated), so overlay consumers like tcxImGui could not shield the tree in secondary windows.
  • New regression test core/tests/mouseBubbling (14 headless behavioral checks), picked up automatically by CI's core-tests step.
  • The new Window tree-dispatch helpers are hidden from the API reference as internal glue.

Verification

  • Headless behavioral test passes on macOS against the merged dev core
  • Reference prose updated (RectNode::onMousePress en/ja/ko); check.js --strict passes locally

- press/release/move now bubble from the front-most hit node to its
  ancestors until a handler consumes (returns true), matching how
  scroll has always propagated; the first press consumer becomes the
  grabbedNode and owns the drag and the matching release
- RectNode defaults still consume, so existing UIs are unchanged;
  return false from onMousePress to let ancestors see the event
- secondary windows now dispatch move/drag/scroll/key to the node
  tree and gate all tree dispatch on !consumed, matching the main
  window (previously only press/release reached the tree, ungated,
  so overlay consumers like imgui could not shield the tree)
- Window gains dispatchMouseMove/Scroll/KeyPress/KeyReleaseToTree
- add core/tests/mouseBubbling: 14 headless behavioral checks
  (bubble-to-consumer with per-level local coords, grab follows the
  consumer, unconsumed walk, front-most consumer stops, move bubbles)
…bbling + secondary-window tree dispatch parity)
@tettou771
tettou771 merged commit 5f8688a into main Jul 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant