[PR #3801] [MERGED] Splitscreen: join with a controller; a lost controller's player waits #5224

Closed
opened 2026-11-03 05:11:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3801
Author: @martipops
Created: 10/29/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: split/08-join-with-controller


📝 Commits (10+)

  • b3e5cb2 Merge remote-tracking branch 'origin/split/02-audio' into split/06-two-players
  • ce0983f Merge remote-tracking branch 'origin/split/04-pointer-ownership' into split/06-two-players
  • 563d85f Merge remote-tracking branch 'origin/split/05-viewports' into split/06-two-players
  • 70a9fd6 Splitscreen: a second player in the same window (HORIZON_SPLIT=N)
  • 9b19ab5 Splitscreen: each controller drives its own player
  • c911e90 splitscreen_e2e: find horizon-ctl.exe on Windows
  • 408ca59 Merge branch 'split/06-two-players' into split/07-controllers
  • 557a675 splitscreen_e2e: replies through a file, so Windows doesn't hang on launch
  • bd6ead7 Merge branch 'split/06-two-players' into split/07-controllers
  • 2edc3b5 Splitscreen: join with a controller; a lost controller's player waits

📊 Changes

20 files changed (+2084 additions, -67 deletions)

View changed files

📝 crates/horizon-client-render/src/gfx.rs (+16 -7)
📝 crates/horizon-client-render/src/widgets.rs (+19 -0)
📝 crates/horizon-client/build.rs (+9 -0)
📝 crates/horizon-client/src/game.rs (+38 -13)
📝 crates/horizon-client/src/game/control.rs (+9 -0)
📝 crates/horizon-client/src/game/discord.rs (+4 -0)
📝 crates/horizon-client/src/game/integrated.rs (+88 -6)
📝 crates/horizon-client/src/game/music.rs (+4 -0)
📝 crates/horizon-client/src/game/options.rs (+19 -2)
📝 crates/horizon-client/src/game/packs.rs (+6 -1)
📝 crates/horizon-client/src/game/pad.rs (+46 -1)
📝 crates/horizon-client/src/game/pad/hardware.rs (+161 -33)
📝 crates/horizon-client/src/game/remote.rs (+6 -2)
📝 crates/horizon-client/src/game/server_packs.rs (+1 -0)
➕ crates/horizon-client/src/game/split.rs (+620 -0)
➕ crates/horizon-client/src/game/split/hud.rs (+225 -0)
➕ crates/horizon-client/src/game/split/pads.rs (+410 -0)
➕ crates/horizon-client/src/game/split/players.rs (+186 -0)
📝 crates/horizon-client/src/lan/conn.rs (+6 -2)
➕ tools/splitscreen_e2e.py (+211 -0)

📄 Description

🤖 Opened by martipops's AI agent (Claude), not by martipops themselves.

Blocked by: #3794 (and through it #3777, #3727)

What and why

Part of the splitscreen series (#3541). Built on #3794, so until it lands the diff below includes
it and the parts it depends on. This part's own commit is 2edc3b57a, +636 −88.

Joining with a controller, as on a console, and a controller that disconnects. While splitscreen
watches the controllers (HORIZON_SPLIT set, any value, until the switch part; HORIZON_SPLIT=1
watches without adding anyone):

  • one controller reader serves every player, alone too: the first controller used is P1's, and
    its output (rumble, the DualSense's triggers and lights) is lent to P1's turn, so no second
    reader opens and alone plays as before;
  • in P1's world, another controller pressing a button is offered to join on every view, a strip
    at the top nobody stops playing for: A joins (as P<seat>), Y drives P1 while P1 has none, B
    says no; the offer goes after 10 s. Several can join at once, in the order they pressed;
  • a controller that disconnects leaves its player's view dimmed and asked: the same controller
    back (by its kind, as macOS gives it a new id) takes the player again with any button, A on
    another takes over the player waiting longest, B lets that player leave. P1 losing its
    controller gets a notice and keeps the keyboard and mouse;
  • each view's badge says who it is for a few seconds when something changes for it ("Keyboard
    and mouse" when it takes them).

Not here yet: giving P1's controller away (the Setup screen's part), profiles to join as, the
switch in Horizon Settings.

Suggested label: skip-release (only reachable with HORIZON_SPLIT).

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on Mac, against upstream/main at 7e42cc8ec, 5 min 12 s)

Check Result
Scope ⚠️ 29 files, +3040 −90; 3054 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (23 s)
rustfmt ✅ (4 s)
clippy ✅ (1 min 25 s)
tests: horizon-client, horizon-client-render ✅ 1377 passed (2 min 33 s)
doc tests ✅ 0 passed (46 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 64 affected, to run in CI (--quick): arrow, block_entity_tickers, block_particles, block_removal, block_transformer, cauldron, chest_pair, command_exec, command_parse, composter, container_title, crafter and 52 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The scope line counts #3794 and the parts below it as well.

  • Unit tests (split::pads): a controller back takes its player with any button; another takes
    over (A) or lets go (B) the longest waiting; only P1 waiting leaves the offer to join; a
    controller the system doesn't describe isn't recognised.
  • Live, tools/splitscreen_e2e.py: new alone (watching, nobody joins, P1 keeps its whole
    window), join, four: pass on macOS, Linux (Fedora 44, GNOME Wayland) and Windows.
  • Windows by hand (martipops, two and three physical controllers, DualSense): P1 on the first
    controller with its output, the offer with B and the timeout, A joins P2 without the press
    acting in its game, a lost controller taken back, taken over, or the player leaving, P1's lost
    controller keeping keyboard and mouse, the badge on the click hand-off. Log clean.

Seen while testing, not from this part: the locator bar shows only on the later player's view
(P2 sees P1's waypoint, P1 never sees P2's); server waypoint tracking, to be looked at separately.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3801 **Author:** [@martipops](https://github.com/martipops) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `split/08-join-with-controller` --- ### 📝 Commits (10+) - [`b3e5cb2`](https://github.com/horizon-rust/horizon/commit/b3e5cb2fa609cb87dd861dd37d1d9d748669dcdf) Merge remote-tracking branch 'origin/split/02-audio' into split/06-two-players - [`ce0983f`](https://github.com/horizon-rust/horizon/commit/ce0983fecc34035d440217ff3fc403001a446fa0) Merge remote-tracking branch 'origin/split/04-pointer-ownership' into split/06-two-players - [`563d85f`](https://github.com/horizon-rust/horizon/commit/563d85f95758086b66f3d046f0fe68412fccfeff) Merge remote-tracking branch 'origin/split/05-viewports' into split/06-two-players - [`70a9fd6`](https://github.com/horizon-rust/horizon/commit/70a9fd6f6a75d25d1c26dfaf26a9f4e26399ae8d) Splitscreen: a second player in the same window (HORIZON_SPLIT=N) - [`9b19ab5`](https://github.com/horizon-rust/horizon/commit/9b19ab5b04934069d9332b3073c3ba22c52eda9c) Splitscreen: each controller drives its own player - [`c911e90`](https://github.com/horizon-rust/horizon/commit/c911e9060de550927a854a3ec3f7995561c1f90a) splitscreen_e2e: find horizon-ctl.exe on Windows - [`408ca59`](https://github.com/horizon-rust/horizon/commit/408ca59a6540691bab3eb8adfaa85c104404ef68) Merge branch 'split/06-two-players' into split/07-controllers - [`557a675`](https://github.com/horizon-rust/horizon/commit/557a675d5dda830cd9e7506fd3e84ef1a31f50f6) splitscreen_e2e: replies through a file, so Windows doesn't hang on launch - [`bd6ead7`](https://github.com/horizon-rust/horizon/commit/bd6ead73c3bd43ddfe259d9762ab6f65e0b7d98a) Merge branch 'split/06-two-players' into split/07-controllers - [`2edc3b5`](https://github.com/horizon-rust/horizon/commit/2edc3b57a46480410ec0726dc34190a444bee771) Splitscreen: join with a controller; a lost controller's player waits ### 📊 Changes **20 files changed** (+2084 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/gfx.rs` (+16 -7) 📝 `crates/horizon-client-render/src/widgets.rs` (+19 -0) 📝 `crates/horizon-client/build.rs` (+9 -0) 📝 `crates/horizon-client/src/game.rs` (+38 -13) 📝 `crates/horizon-client/src/game/control.rs` (+9 -0) 📝 `crates/horizon-client/src/game/discord.rs` (+4 -0) 📝 `crates/horizon-client/src/game/integrated.rs` (+88 -6) 📝 `crates/horizon-client/src/game/music.rs` (+4 -0) 📝 `crates/horizon-client/src/game/options.rs` (+19 -2) 📝 `crates/horizon-client/src/game/packs.rs` (+6 -1) 📝 `crates/horizon-client/src/game/pad.rs` (+46 -1) 📝 `crates/horizon-client/src/game/pad/hardware.rs` (+161 -33) 📝 `crates/horizon-client/src/game/remote.rs` (+6 -2) 📝 `crates/horizon-client/src/game/server_packs.rs` (+1 -0) ➕ `crates/horizon-client/src/game/split.rs` (+620 -0) ➕ `crates/horizon-client/src/game/split/hud.rs` (+225 -0) ➕ `crates/horizon-client/src/game/split/pads.rs` (+410 -0) ➕ `crates/horizon-client/src/game/split/players.rs` (+186 -0) 📝 `crates/horizon-client/src/lan/conn.rs` (+6 -2) ➕ `tools/splitscreen_e2e.py` (+211 -0) </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Claude), not by martipops themselves. **Blocked by:** #3794 (and through it #3777, #3727) ## What and why Part of the splitscreen series (#3541). Built on #3794, so until it lands the diff below includes it and the parts it depends on. This part's own commit is 2edc3b57a, +636 −88. Joining with a controller, as on a console, and a controller that disconnects. While splitscreen watches the controllers (`HORIZON_SPLIT` set, any value, until the switch part; `HORIZON_SPLIT=1` watches without adding anyone): - one controller reader serves every player, alone too: the first controller used is P1's, and its output (rumble, the DualSense's triggers and lights) is lent to P1's turn, so no second reader opens and alone plays as before; - in P1's world, another controller pressing a button is offered to join on every view, a strip at the top nobody stops playing for: A joins (as P\<seat\>), Y drives P1 while P1 has none, B says no; the offer goes after 10 s. Several can join at once, in the order they pressed; - a controller that disconnects leaves its player's view dimmed and asked: the same controller back (by its kind, as macOS gives it a new id) takes the player again with any button, A on another takes over the player waiting longest, B lets that player leave. P1 losing its controller gets a notice and keeps the keyboard and mouse; - each view's badge says who it is for a few seconds when something changes for it ("Keyboard and mouse" when it takes them). Not here yet: giving P1's controller away (the Setup screen's part), profiles to join as, the switch in Horizon Settings. Suggested label: `skip-release` (only reachable with `HORIZON_SPLIT`). ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Mac, against upstream/main at 7e42cc8ec, 5 min 12 s) | Check | Result | | --- | --- | | Scope | ⚠️ 29 files, +3040 −90; 3054 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (23 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (1 min 25 s) | | tests: horizon-client, horizon-client-render | ✅ 1377 passed (2 min 33 s) | | doc tests | ✅ 0 passed (46 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 64 affected, to run in CI (--quick): arrow, block_entity_tickers, block_particles, block_removal, block_transformer, cauldron, chest_pair, command_exec, command_parse, composter, container_title, crafter and 52 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The scope line counts #3794 and the parts below it as well. - Unit tests (`split::pads`): a controller back takes its player with any button; another takes over (A) or lets go (B) the longest waiting; only P1 waiting leaves the offer to join; a controller the system doesn't describe isn't recognised. - Live, `tools/splitscreen_e2e.py`: new `alone` (watching, nobody joins, P1 keeps its whole window), `join`, `four`: pass on macOS, Linux (Fedora 44, GNOME Wayland) and Windows. - Windows by hand (martipops, two and three physical controllers, DualSense): P1 on the first controller with its output, the offer with B and the timeout, A joins P2 without the press acting in its game, a lost controller taken back, taken over, or the player leaving, P1's lost controller keeping keyboard and mouse, the badge on the click hand-off. Log clean. Seen while testing, not from this part: the locator bar shows only on the later player's view (P2 sees P1's waypoint, P1 never sees P2's); server waypoint tracking, to be looked at separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:04 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5224
No description provided.