Skip to content

Soft-fail missing seat keyboard/pointer (H1) - #23

Merged
ElSargo merged 1 commit into
mainfrom
fix/seat-device-soft-fail
Sep 16, 2026
Merged

ElSargo merged 1 commit into
mainfrom
fix/seat-device-soft-fail

Conversation

@ElSargo

@ElSargo ElSargo commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace hot-path .expect("keyboard") / .expect("pointer") in crates/broodd/src/input.rs with warn! + early return so seat teardown / capability loss drops events instead of aborting the compositor.
  • Apply the same soft-fail pattern to the related seat-keyboard call sites in state.rs (reset_transient_input_state, focus helpers, focus repair).
  • Export should_forward_managed_pointer_button and add crates/broodd/tests/input_forwarding.rs covering press/release forwarding rules.
  • Out of scope (residual): H2 bootstrap .expects on event-loop insert / Wayland socket setup in state.rs init — not the same hot-path class.

Test plan

  • RUSTFLAGS='-C linker=cc -L/tmp/brood-link' cargo test -p broodd --test input_forwarding --test scheduling_domain --test session_volume (2 + 10 + 3 passed; local unversioned .so symlinks for xkbcommon/gbm because host lacks linker names)
  • RUSTFLAGS='-C linker=cc' cargo check -p broodd --lib
  • cargo test -p brood-protocol --lib (14 passed)
  • Nix/nix develop CI parity if available on reviewer machine

@ElSargo ElSargo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (H1 soft-fail seat keyboard/pointer)

Verdict: APPROVE (posted as comment — gh as ElSargo cannot formally APPROVE own PRs)

What looks good

  • Removes all hot-path .expect("keyboard"|"pointer") from crates/broodd/src/input.rs and the audited state.rs seat-keyboard call sites (reset_transient_input_state, focus helpers, focus repair).
  • Soft-fail pattern is consistent: warn! + drop/skip instead of aborting the compositor — matches audit H1.
  • focus_pane_from_presentation_client correctly returns true after Brood-side focus update when the seat keyboard is missing.
  • Focus-repair path still runs reconfigure_focus_stack / window-count update when keyboard is absent.
  • Residual H2 bootstrap expects correctly left out of scope.
  • should_forward_managed_pointer_button export + tests/input_forwarding.rs lock in the press/release forwarding rules.

CI

  • Current CI failure is infra disk-full (No space left on device during Nix unpack of neovim/rustc), not a code regression. Please re-run when the runner has disk.

Local checks (reviewer)

  • cargo test -p broodd --test input_forwarding --test scheduling_domain --test session_volume → 2+10+3 passed
  • cargo test -p brood-protocol --lib → 14 passed
  • cargo check -p broodd --lib → ok

Non-blocking nits / follow-ups

  1. In forward_pointer_button_to_pane, missing keyboard currently drops the entire button path (including releases that should clear grabs). Consider forwarding pointer.button whenever the pointer exists and only skipping the keyboard focus branch.
  2. forwarded_pressed_keys is updated before the keyboard soft-fail check — minor phantom-release risk if the keyboard returns later.
  3. Audit M2 (hot-path info! on button/axis) remains; fine to keep out of this PR.

Desktop

Not required for this change — seat teardown / capability-loss crash paths are hard to exercise on desktop; soft-fail + focused tests are enough.

@ElSargo ElSargo left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brood QA review

Checked: diff/view; CI 35146931568; audit H1.

Code: Correct H1 soft-fail. Hot-path .expect("keyboard"|"pointer") in input.rs and related seat focus helpers in state.rs become warn! + early return / skip. should_forward_managed_pointer_button exported with press/release semantics preserved (release always forwards). Thin integration test added. Out-of-scope H2 bootstrap expects correctly left alone.

CI: FAILURE — runner ENOSPC during Nix/source unpack. Infra. Author reports targeted broodd tests + cargo check -p broodd green locally.

Race-doc: N/A (not a ui-concurrency remittance).

Desktop verify: Blocked (no nix/client build on QA box). Soft-fail behavior needs seat teardown repro once buildable.

Residual / merge: Re-run CI after disk relief. Residual H2 bootstrap panics remain by design for this PR.

— Brood QA

Seat teardown or capability glitches previously aborted the compositor via
.expect("keyboard"|"pointer") on every forwarded event and related focus
helpers. Log and drop/skip instead so input/focus can degrade without a panic.
@ElSargo
ElSargo force-pushed the fix/seat-device-soft-fail branch from af49085 to 178faac Compare September 16, 2026 21:47
@ElSargo
ElSargo merged commit 6b15e08 into main Sep 16, 2026
1 check failed
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