[PR #6395] [MERGED] Splitscreen: Setup map, Apply/Revert and mouse focus #6842

Closed
opened 2026-11-03 06:27:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: split/fresh-basic-setup


📝 Commits (10+)

  • 8a65c97 Merge the profiles prerequisite onto current main for Setup
  • d48b592 Splitscreen: arrange players with a Setup map and Apply/Revert
  • fb0496a Align Setup pause icons and seed the saved switch in live checks
  • 69ce6f6 Merge current main into the Setup rebuild
  • 8ac0773 Keep native mouse ownership when a second local player joins
  • a5da7ab Keep the native mouse regression fixture portable across filesystem paths
  • adea816 Merge current main into the Setup draft before localization fixes
  • b3dcefa Localize the splitscreen Setup screen and its window feedback
  • 972519a Setup's switch says On/Off from its own keys, not vanilla's ON/OFF
  • b1259ce Merge upstream main into the Setup PR

📊 Changes

19 files changed (+1907 additions, -89 deletions)

View changed files

📝 crates/horizon-client-render/src/lib.rs (+2 -0)
📝 crates/horizon-client-render/src/options_ui.rs (+32 -12)
📝 crates/horizon-client-render/src/split_layout.rs (+487 -25)
➕ crates/horizon-client-render/src/split_map.rs (+166 -0)
➕ crates/horizon-client-render/src/split_ui.rs (+716 -0)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+31 -2)
📝 crates/horizon-client/assets/horizon/lang/fr_fr.json (+35 -6)
📝 crates/horizon-client/src/client_lib.rs (+3 -3)
📝 crates/horizon-client/src/game.rs (+11 -6)
📝 crates/horizon-client/src/game/agent.rs (+9 -2)
📝 crates/horizon-client/src/game/screens.rs (+21 -10)
📝 crates/horizon-client/src/game/split.rs (+11 -10)
📝 crates/horizon-client/src/game/split/hud.rs (+8 -2)
📝 crates/horizon-client/src/game/split/players.rs (+1 -0)
➕ crates/horizon-client/src/game/split/setup.rs (+155 -0)
📝 crates/horizon-client/src/game/split/windows.rs (+12 -5)
📝 docs/extras.md (+6 -1)
📝 tests/test_world_input_capture.py (+109 -5)
📝 tools/splitscreen_e2e.py (+92 -0)

📄 Description

🤖 Opened by martipops's AI agent (Codex, GPT-6), not by martipops personally.

What and why

P1 can preview which windows and monitors local players use, change a draft arrangement, then Apply it or discard it with Revert/Done. Joining or leaving resets the draft so a move cannot target the wrong seat. P1's pause shortcut opens Setup; guests keep their profile shortcut.

The mouse-focus fix is in this PR. P1 keeps native capture when P2 joins the same window, and visible composited views accept real mouse motion. Hidden offscreen runs keep their existing pointer isolation. Portable capture and motion regressions are included here; the desktop native-input scenario comes with the controller/test-harness part.

Includes the arrangement/map model formerly in #4164 and usable screen/runtime formerly in #4165, rebuilt after #5675 merged. About 1,700 added lines include the model, projection, page/runtime and tests. Refs #2054 and #3541.

Dependency

Series (merge order): #6395 → #6397 → #6398 → #6399.

First of four dependent drafts; #5675 is merged. The branch is based on main aef5284bb and also merges cleanly with main ac2f22371. Merge the series in order.

Review this increment.

Kind

  • feature: something new for players (listed under New in the release notes)

Vanilla reference

Horizon-only. Java Edition has no local splitscreen; world simulation uses the existing integrated-server and multiplayer paths.

Other projects' code

None. This ports the remaining pieces of the existing splitscreen series in this repository.

Update: localization and current main

Updated by martipops's AI agent (Claude Code, Claude Opus 5.5). Main f4833621f is merged into the series (one conflict in client_lib.rs: both re-exports kept); the series also merges cleanly with main 4789fc28f. Setup's labels, title, status lines, warnings, tooltips and its window feedback now come from horizon.splitscreen.setup.* language keys (English and French; other languages fall back to English). Player names stay literal; the agent-facing status values off/idle/active stay language independent. Status text wraps to the available width. A process-isolated test switches English → French → a resource-pack override and checks the draft, Apply, warnings and the German fallback.

Checked at the new heads: cargo test -p horizon-client-render --lib split (47 tests here; 60 on #6397, 66 and 13 game-side on #6398/#6399), the bundled-language tests, rustfmt, and Clippy -D warnings on horizon-client and horizon-client-render. The full live suite (tools/splitscreen_e2e.py, without the opt-in native_pointer) passes on the #6399 head. It caught the switch reading "Splitscreen: OFF" with prepared resources, fixed in #6395 (972519acd); pausemenu now expects Splitscreen Settings in the pause menu only while another player plays, which is the intended behaviour. The validation below predates this update.

Validation

The complete stack at 73f9ba613 was tested on macOS with the default Metal renderer:

  • The author retested the mouse-focus fix with a physical controller and confirmed it works.
  • The opt-in native_pointer scenario passes real OS keyboard/mouse checks: P1 keeps control after P2 joins without another click; only the owner moves and turns; P2's controller menu leaves P1 alone; held keys are released on handoff; ownership follows clicks across separate windows; mouse look still works after the last guest leaves. The old build reproduced the native-camera failure.
  • Four portable input tests pass, including capture, actual mouse-rotation math and keeping capture when only the viewport changes. The 596-test Python suite passes (one skipped).
  • Real-window join, setup, setup_leave, controls, pointer and server scenarios pass after the fix.
  • Offscreen packs, dedicated_profiles, integrated_profiles and signedin checks also pass: one shared resource-pack download, inventory/health/XP/position persistence across standalone joins and a dedicated-server restart, LAN profile continuity, and signed-in P1 staying separate from offline guests.
  • The earlier stack run passed 11 game-side split tests and 65 layout, Setup, map and profile tests. The final fast build, formatting and all-target Clippy with warnings denied pass.

Windows and Wayland have not been revalidated on this rebuild. Local vanilla parity was not run. These are stack results; they are not a separate full test run for each intermediate branch.

Self-check

This is the self-check of the complete four-part stack against its pinned main base aef5284bb. The scope is cumulative. The two TNT failures below also reproduce on unmodified main at that base: a_soul_sand_bubble_column_lifts_primed_tnt and primed_tnt_follows_water_currents_after_moving. A separate client-library run also reported entities::armor_stand_motion_tests::a_tick_keeps_the_previous_position_for_interpolation; that exact test also fails on unmodified main at aef5284bb with the same an airborne stand must fall, y=20 assertion. No parity tests were removed or weakened.

pr_ready (tools/pr_ready.py --quick --base aef5284bb on Mac, against aef5284bb at aef5284bb, 3 min 22 s)

Check Result
Scope ⚠️ 28 files, +4068 −145; 4071 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 596 passed (41 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 7 s)
tests: horizon-client, horizon-client-lib, horizon-client-render ❌ 559 passed, 2 failed (1 min 26 s)
doc tests ✅ 0 passed (3 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Screenshots

Setup map and draft preview from the prepared Setup branch; the mouse-only follow-up does not change their UI.

Setup map

Draft before Apply

🤖 Generated with Codex


🔄 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/6395 **Author:** [@martipops](https://github.com/martipops) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `split/fresh-basic-setup` --- ### 📝 Commits (10+) - [`8a65c97`](https://github.com/horizon-rust/horizon/commit/8a65c97f3b2ee6a1f2536db6faa2bedbca5f62a8) Merge the profiles prerequisite onto current main for Setup - [`d48b592`](https://github.com/horizon-rust/horizon/commit/d48b592ddde908a6ccba643cc27d1411bbdebd95) Splitscreen: arrange players with a Setup map and Apply/Revert - [`fb0496a`](https://github.com/horizon-rust/horizon/commit/fb0496a105f785cfb7e9165d3c228935161e9a6f) Align Setup pause icons and seed the saved switch in live checks - [`69ce6f6`](https://github.com/horizon-rust/horizon/commit/69ce6f6c2635ceb282e0d8ea9dfc0bf2197286d0) Merge current main into the Setup rebuild - [`8ac0773`](https://github.com/horizon-rust/horizon/commit/8ac07733050b65418c83772146e6e6bc3f7eda85) Keep native mouse ownership when a second local player joins - [`a5da7ab`](https://github.com/horizon-rust/horizon/commit/a5da7abce2db7a399dd3d8cfe004284f77f344ed) Keep the native mouse regression fixture portable across filesystem paths - [`adea816`](https://github.com/horizon-rust/horizon/commit/adea816573d33afa17d8843006bec63c23c8e828) Merge current main into the Setup draft before localization fixes - [`b3dcefa`](https://github.com/horizon-rust/horizon/commit/b3dcefa2ac3f6c02e06d45b165c0bc1252a9d01f) Localize the splitscreen Setup screen and its window feedback - [`972519a`](https://github.com/horizon-rust/horizon/commit/972519acdc626ead6b8945c256b443ac10df92a2) Setup's switch says On/Off from its own keys, not vanilla's ON/OFF - [`b1259ce`](https://github.com/horizon-rust/horizon/commit/b1259ce32aadcf36ce98aa13d450aed905142325) Merge upstream main into the Setup PR ### 📊 Changes **19 files changed** (+1907 additions, -89 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/lib.rs` (+2 -0) 📝 `crates/horizon-client-render/src/options_ui.rs` (+32 -12) 📝 `crates/horizon-client-render/src/split_layout.rs` (+487 -25) ➕ `crates/horizon-client-render/src/split_map.rs` (+166 -0) ➕ `crates/horizon-client-render/src/split_ui.rs` (+716 -0) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+31 -2) 📝 `crates/horizon-client/assets/horizon/lang/fr_fr.json` (+35 -6) 📝 `crates/horizon-client/src/client_lib.rs` (+3 -3) 📝 `crates/horizon-client/src/game.rs` (+11 -6) 📝 `crates/horizon-client/src/game/agent.rs` (+9 -2) 📝 `crates/horizon-client/src/game/screens.rs` (+21 -10) 📝 `crates/horizon-client/src/game/split.rs` (+11 -10) 📝 `crates/horizon-client/src/game/split/hud.rs` (+8 -2) 📝 `crates/horizon-client/src/game/split/players.rs` (+1 -0) ➕ `crates/horizon-client/src/game/split/setup.rs` (+155 -0) 📝 `crates/horizon-client/src/game/split/windows.rs` (+12 -5) 📝 `docs/extras.md` (+6 -1) 📝 `tests/test_world_input_capture.py` (+109 -5) 📝 `tools/splitscreen_e2e.py` (+92 -0) </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Codex, GPT-6), not by martipops personally. ## What and why P1 can preview which windows and monitors local players use, change a draft arrangement, then Apply it or discard it with Revert/Done. Joining or leaving resets the draft so a move cannot target the wrong seat. P1's pause shortcut opens Setup; guests keep their profile shortcut. **The mouse-focus fix is in this PR.** P1 keeps native capture when P2 joins the same window, and visible composited views accept real mouse motion. Hidden offscreen runs keep their existing pointer isolation. Portable capture and motion regressions are included here; the desktop native-input scenario comes with the controller/test-harness part. Includes the arrangement/map model formerly in #4164 and usable screen/runtime formerly in #4165, rebuilt after #5675 merged. About 1,700 added lines include the model, projection, page/runtime and tests. Refs #2054 and #3541. ## Dependency Series (merge order): [#6395](https://github.com/horizon-rust/horizon/pull/6395) → [#6397](https://github.com/horizon-rust/horizon/pull/6397) → [#6398](https://github.com/horizon-rust/horizon/pull/6398) → [#6399](https://github.com/horizon-rust/horizon/pull/6399). First of four dependent drafts; #5675 is merged. The branch is based on main `aef5284bb` and also merges cleanly with main `ac2f22371`. Merge the series in order. [Review this increment](https://github.com/martipops/horizon/compare/f4833621f...972519acdc626ead6b8945c256b443ac10df92a2). ## Kind - [x] feature: something new for players (listed under New in the release notes) ## Vanilla reference Horizon-only. Java Edition has no local splitscreen; world simulation uses the existing integrated-server and multiplayer paths. ## Other projects' code None. This ports the remaining pieces of the existing splitscreen series in this repository. ## Update: localization and current main Updated by martipops's AI agent (Claude Code, Claude Opus 5.5). Main `f4833621f` is merged into the series (one conflict in `client_lib.rs`: both re-exports kept); the series also merges cleanly with main `4789fc28f`. Setup's labels, title, status lines, warnings, tooltips and its window feedback now come from `horizon.splitscreen.setup.*` language keys (English and French; other languages fall back to English). Player names stay literal; the agent-facing status values `off/idle/active` stay language independent. Status text wraps to the available width. A process-isolated test switches English → French → a resource-pack override and checks the draft, Apply, warnings and the German fallback. Checked at the new heads: `cargo test -p horizon-client-render --lib split` (47 tests here; 60 on #6397, 66 and 13 game-side on #6398/#6399), the bundled-language tests, rustfmt, and Clippy `-D warnings` on horizon-client and horizon-client-render. The full live suite (`tools/splitscreen_e2e.py`, without the opt-in `native_pointer`) passes on the #6399 head. It caught the switch reading "Splitscreen: OFF" with prepared resources, fixed in #6395 (`972519acd`); `pausemenu` now expects Splitscreen Settings in the pause menu only while another player plays, which is the intended behaviour. The validation below predates this update. ## Validation The complete stack at `73f9ba613` was tested on macOS with the default Metal renderer: - The author retested the mouse-focus fix with a physical controller and confirmed it works. - The opt-in `native_pointer` scenario passes real OS keyboard/mouse checks: P1 keeps control after P2 joins without another click; only the owner moves and turns; P2's controller menu leaves P1 alone; held keys are released on handoff; ownership follows clicks across separate windows; mouse look still works after the last guest leaves. The old build reproduced the native-camera failure. - Four portable input tests pass, including capture, actual mouse-rotation math and keeping capture when only the viewport changes. The 596-test Python suite passes (one skipped). - Real-window `join`, `setup`, `setup_leave`, `controls`, `pointer` and `server` scenarios pass after the fix. - Offscreen `packs`, `dedicated_profiles`, `integrated_profiles` and `signedin` checks also pass: one shared resource-pack download, inventory/health/XP/position persistence across standalone joins and a dedicated-server restart, LAN profile continuity, and signed-in P1 staying separate from offline guests. - The earlier stack run passed 11 game-side split tests and 65 layout, Setup, map and profile tests. The final fast build, formatting and all-target Clippy with warnings denied pass. Windows and Wayland have not been revalidated on this rebuild. Local vanilla parity was not run. These are stack results; they are not a separate full test run for each intermediate branch. ## Self-check This is the self-check of the complete four-part stack against its pinned main base `aef5284bb`. The scope is cumulative. The two TNT failures below also reproduce on unmodified main at that base: `a_soul_sand_bubble_column_lifts_primed_tnt` and `primed_tnt_follows_water_currents_after_moving`. A separate client-library run also reported `entities::armor_stand_motion_tests::a_tick_keeps_the_previous_position_for_interpolation`; that exact test also fails on unmodified main at `aef5284bb` with the same `an airborne stand must fall, y=20` assertion. No parity tests were removed or weakened. **pr_ready** (`tools/pr_ready.py --quick --base aef5284bb` on Mac, against aef5284bb at aef5284bb, 3 min 22 s) | Check | Result | | --- | --- | | Scope | ⚠️ 28 files, +4068 −145; 4071 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 596 passed (41 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 7 s) | | tests: horizon-client, horizon-client-lib, horizon-client-render | ❌ 559 passed, 2 failed (1 min 26 s) | | doc tests | ✅ 0 passed (3 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Screenshots Setup map and draft preview from the prepared Setup branch; the mouse-only follow-up does not change their UI. ![Setup map](https://raw.githubusercontent.com/martipops/horizon/a5ec02e008cef9f037e6b836f4a84dcf7faa7da9/docs/media/splitscreen-setup-map.png) ![Draft before Apply](https://raw.githubusercontent.com/martipops/horizon/a5ec02e008cef9f037e6b836f4a84dcf7faa7da9/docs/media/splitscreen-setup-preview.png) 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:27:53 +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#6842
No description provided.