fix(linux): the cursor over the game's window hides while a controller or the keys are used, as on Windows #2440

Merged
HumanBean merged 2 commits from jabbaxipil/Longshot:fix/linux-cursor-hide into main 2026-11-28 05:14:08 +00:00
Contributor

Summary

On Linux the mouse cursor stayed over the game while you played with a controller, in the middle of the picture, until the mouse moved (#892: Bazzite, KDE Wayland). On Windows it hides once the pads or the keys are used and comes back when the mouse is (host/display.c, gm_cursor_shown). The Linux window (host/posix/display_sdl.c) hid it only while the mouse was captured for the camera.

The SDL window now keeps the Windows rule: hidden once hos_player_input_ns (nn_hid.c: a pad button, a stick past a third, a bound key) is newer than the mouse's last use; shown again by a move of more than 4 units from the last point one counted at, or by a button. The first move after the window changes size only sets that point (SDL can report a cursor at rest at a new point after F11). The Insert menu shows it, for its clicks, and so does losing the focus. host/hos_sdl.c gains hos_sdl_cursor: SDL3's SDL_ShowCursor / SDL_HideCursor, SDL2's SDL_ShowCursor(1 or 0), both looked up as optional.

To see it on main: on Linux, start the game in a window, put the mouse over it and play with a controller: the cursor stays.

Read first: the block above keys_update() in host/posix/display_sdl.c, then hos_sdl_cursor in host/hos_sdl.c.

See #892 (its Linux report; the idle timer proposed there is not part of this, and Windows has none either).

Testing

Tested: Ubuntu 26.04.1 (Linux 7.0.0-44), GNOME Wayland, RTX 4070 (NVIDIA 615.71.09), Ryzen 7 5800X3D; a build of 9411a6c4 (on main @ 8aa5ab87), in a 1600x900 window, SDL3 (the log's sdl: SDL3), a GameSir G7 Pro controller (Xbox layout), adult Link in Hyrule Field.

  • In the game, by hand: with the mouse over the window and no click, a controller button hid the cursor; a small nudge of the mouse left it hidden; a real move brought it back. The run ended cleanly (no crash or device lost, 0 kernel messages).
  • python3 -I -B tests/test_cursor_hidden_linux.py (new): passed before the latest changes. It runs the rule cut from display_sdl.c (shown at start, hidden by a pad, 4 units of slack from the last counted point, the point after a resize, the Insert menu, the focus, SDL asked only on a change) and reads the event loop's lines and the SDL3/SDL2 calls. With main's sources it stops with srccut: ... is not in host/posix/display_sdl.c; it also fails on seven broken versions of the change (no slack, no focus or menu condition, no reset on resize, SDL asked every loop, the point not moved, the SDL2 call changed).
  • tests/test_display_pointer.py compiles the SDL window's click handler: its stand-ins gain gm_mouse_used(); passes with clang++ and g++. This and the new test also passed at 5437658d.
  • python3 -I -B tests/run_all.py --strict --jobs 8 (what mise run test runs), 5437658d and main @ 8aa5ab87 in the same sitting: 841 passed / 121 failed / 18 skipped here, 840 / 121 / 18 on main, the same 121 failing. 104 of them are --strict refusing for test tools this PC lacks; the others fail on main too (among them test_menu_text_field, test_crt_options, test_vibration_menu, test_dev_packs, test_pipeline_share).

Still to test:

  • Linux, SDL2 (libSDL2-2.0.so.0 without a system SDL3) on X11 or Wayland: the same three steps, expecting the same (by hand).
  • Steam Deck, game mode (gamescope): playing with the built-in controls, expecting no cursor over the game, and the touchscreen and trackpad mouse still showing it when used (by hand).
  • KDE Wayland, the reporter's desktop: the same three steps (by hand).
  • Windows (llvm-mingw): a build of the host. host/hos_sdl.c is compiled there too and gains plain C only (hos_sdl_cursor, two optional lookups); nothing on Windows calls it. There is no Windows compiler on this PC (CI, or by hand).

Measurements

Nothing to measure: one comparison and, on a change, one SDL call per pass of the window loop; no rendering change.

Risks

A player who uses the mouse only by clicking, without moving it, sees the cursor come back at the click (as on Windows). Where SDL has no cursor calls (none known), nothing changes. A revert is enough; nothing changes in saves, options or caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • A check under tests/ that reads changed source is updated, not weakened.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary On Linux the mouse cursor stayed over the game while you played with a controller, in the middle of the picture, until the mouse moved (#892: Bazzite, KDE Wayland). On Windows it hides once the pads or the keys are used and comes back when the mouse is (`host/display.c`, `gm_cursor_shown`). The Linux window (`host/posix/display_sdl.c`) hid it only while the mouse was captured for the camera. The SDL window now keeps the Windows rule: hidden once `hos_player_input_ns` (nn_hid.c: a pad button, a stick past a third, a bound key) is newer than the mouse's last use; shown again by a move of more than 4 units from the last point one counted at, or by a button. The first move after the window changes size only sets that point (SDL can report a cursor at rest at a new point after F11). The Insert menu shows it, for its clicks, and so does losing the focus. `host/hos_sdl.c` gains `hos_sdl_cursor`: SDL3's `SDL_ShowCursor` / `SDL_HideCursor`, SDL2's `SDL_ShowCursor(1 or 0)`, both looked up as optional. To see it on main: on Linux, start the game in a window, put the mouse over it and play with a controller: the cursor stays. Read first: the block above `keys_update()` in `host/posix/display_sdl.c`, then `hos_sdl_cursor` in `host/hos_sdl.c`. See #892 (its Linux report; the idle timer proposed there is not part of this, and Windows has none either). ## Testing **Tested:** Ubuntu 26.04.1 (Linux 7.0.0-44), GNOME Wayland, RTX 4070 (NVIDIA 615.71.09), Ryzen 7 5800X3D; a build of `9411a6c4` (on main @ 8aa5ab87), in a 1600x900 window, SDL3 (the log's `sdl: SDL3`), a GameSir G7 Pro controller (Xbox layout), adult Link in Hyrule Field. - In the game, by hand: with the mouse over the window and no click, a controller button hid the cursor; a small nudge of the mouse left it hidden; a real move brought it back. The run ended cleanly (no crash or device lost, 0 kernel messages). - `python3 -I -B tests/test_cursor_hidden_linux.py` (new): passed before the latest changes. It runs the rule cut from `display_sdl.c` (shown at start, hidden by a pad, 4 units of slack from the last counted point, the point after a resize, the Insert menu, the focus, SDL asked only on a change) and reads the event loop's lines and the SDL3/SDL2 calls. With main's sources it stops with `srccut: ... is not in host/posix/display_sdl.c`; it also fails on seven broken versions of the change (no slack, no focus or menu condition, no reset on resize, SDL asked every loop, the point not moved, the SDL2 call changed). - `tests/test_display_pointer.py` compiles the SDL window's click handler: its stand-ins gain `gm_mouse_used()`; passes with clang++ and g++. This and the new test also passed at `5437658d`. - `python3 -I -B tests/run_all.py --strict --jobs 8` (what `mise run test` runs), `5437658d` and main @ 8aa5ab87 in the same sitting: 841 passed / 121 failed / 18 skipped here, 840 / 121 / 18 on main, the same 121 failing. 104 of them are `--strict` refusing for test tools this PC lacks; the others fail on main too (among them `test_menu_text_field`, `test_crt_options`, `test_vibration_menu`, `test_dev_packs`, `test_pipeline_share`). **Still to test:** - Linux, SDL2 (`libSDL2-2.0.so.0` without a system SDL3) on X11 or Wayland: the same three steps, expecting the same (by hand). - Steam Deck, game mode (gamescope): playing with the built-in controls, expecting no cursor over the game, and the touchscreen and trackpad mouse still showing it when used (by hand). - KDE Wayland, the reporter's desktop: the same three steps (by hand). - Windows (llvm-mingw): a build of the host. `host/hos_sdl.c` is compiled there too and gains plain C only (`hos_sdl_cursor`, two optional lookups); nothing on Windows calls it. There is no Windows compiler on this PC (CI, or by hand). ## Measurements Nothing to measure: one comparison and, on a change, one SDL call per pass of the window loop; no rendering change. ## Risks A player who uses the mouse only by clicking, without moving it, sees the cursor come back at the click (as on Windows). Where SDL has no cursor calls (none known), nothing changes. A revert is enough; nothing changes in saves, options or caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [ ] A fix: a game-free test that fails on `main` and passes here. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
fix(linux): the cursor over the game's window hides while a controller or the keys are used, as on Windows
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
5437658d73
On Windows the cursor over the window is shown until the pads or the keys are used and again once the mouse is
(host/display.c gm_cursor_shown). The SDL window on Linux hid it only while the mouse was captured, so a player on a
controller had it in the middle of the picture (#892, KDE Wayland). host/posix/display_sdl.c now keeps the same rule:
hidden once hos_player_input_ns is newer than the mouse's last use, shown by a move of more than 4 units from the last
point one counted at, or a button; the first move after the window changed size only sets the point. The Insert menu
shows it, and so does losing the focus. host/hos_sdl.c gains hos_sdl_cursor: SDL3's SDL_ShowCursor and SDL_HideCursor,
SDL2's SDL_ShowCursor(1 or 0), looked up as optional.

tests/test_cursor_hidden_linux.py runs the rule cut from the source and reads the event loop's lines and the SDL calls;
tests/display_pointer_test.cpp gets a stand-in for the new call in its copy of the SDL click.

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Ubuntu 26.04.1 GNOME Wayland, RTX 4070 (NVIDIA 615.71.09), SDL3, a build of 9411a6c4 in a 1600x900 window, adult Link in Hyrule Field, a GameSir G7 Pro controller: with the mouse over the window and no click, a controller button hid the cursor, a small nudge left it hidden, a real move brought it back. The run ended cleanly (no crash or device lost).

Tested in game: Ubuntu 26.04.1 GNOME Wayland, RTX 4070 (NVIDIA 615.71.09), SDL3, a build of 9411a6c4 in a 1600x900 window, adult Link in Hyrule Field, a GameSir G7 Pro controller: with the mouse over the window and no click, a controller button hid the cursor, a small nudge left it hidden, a real move brought it back. The run ended cleanly (no crash or device lost).
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The first mouse movement can be discarded after controller input, leaving the cursor hidden when the player tries to use it. The new test also hard-codes GCC instead of using the configured compiler.

The change hides the Linux cursor after controller or bound-key input and restores it for mouse use, the Insert menu, or loss of focus. It keeps the visibility logic small, but its initial mouse position is not established until a motion event arrives.

Blocking (1): must change before merging.

  1. L1 host/posix/display_sdl.c:110: The first real mouse movement is discarded if no motion event has established the initial point. (more on the line) Do: Establish the initial point from the current SDL mouse position when the window is created, and add a test that hides the cursor before the first motion event.

Should fix (1): not blocking, but worth doing before merging.

  • L2 tests/test_cursor_hidden_linux.py:22: The test runner is forced to use gcc instead of its configured C compiler. (more on the line) Do: Declare the runner's {cc} placeholder and use the configured compiler for direct invocation as well.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The SDL2 cursor path has not been exercised in the game. When: A Linux player using SDL2 takes a different cursor API and relative-mouse path from the tested SDL3 setup. Do: Run the hide, mouse restore, menu and capture transitions with SDL2 on Linux.
  • L4: The reported KDE Wayland environment and Steam Deck game mode have not been exercised. When: The fix changes cursor visibility and mouse handling on these Linux compositor and input paths, including Deck trackpad and touchscreen input. Do: Run the reported controller and mouse sequence on KDE Wayland, and verify built-in controls, trackpad and touchscreen in Deck game mode.

@fix can do L1 and L2.

Checks: Still running: 9 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes, for the reported controller case on the tested SDL3 setup: the author observed the cursor hide on controller input and return on a real mouse move. SDL2 and the reporter's KDE Wayland setup remain untested.

Other systems: The new SDL adapter is compiled on Windows but called by the Linux window only. SDL2, KDE Wayland, and Steam Deck game mode can follow different cursor and input paths and have no reported game run; the SDL3 GNOME Wayland run is positive. The input timestamp is read through the existing interlocked accessor.

Switches: None.

Reviewed: 5437658d73 against 8aa5ab876d: Read the diff, commit, repository rules and PR template, changed cursor code and test, and the surrounding SDL event loop, input timestamp, capture, and test-runner paths. Skimmed the remainder of the large SDL adapter, pointer fixture, and standards; docs/review-checklist.md and the adjacent Tooling checkout were absent. No generated files or recorded runs were changed.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance.
  • No game-derived files, generated files, switches, or renderer API changes appear in the diff.
  • The SDL calls are made on the window thread, and the player-input timestamp uses the existing interlocked accessor.
  • The authored SDL3 game run demonstrates the principal controller hide and mouse restore behavior.

Testing: No commands from the project were run, as requested. The author reports an SDL3 game run and game-free test results; CI is still running.

Overlaps and merge order: Not determined from the supplied checkout and PR data.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The first mouse movement can be discarded after controller input, leaving the cursor hidden when the player tries to use it. The new test also hard-codes GCC instead of using the configured compiler. The change hides the Linux cursor after controller or bound-key input and restores it for mouse use, the Insert menu, or loss of focus. It keeps the visibility logic small, but its initial mouse position is not established until a motion event arrives. **Blocking (1)**: must change before merging. 1. **L1** `host/posix/display_sdl.c:110`: The first real mouse movement is discarded if no motion event has established the initial point. (more on the line) **Do:** Establish the initial point from the current SDL mouse position when the window is created, and add a test that hides the cursor before the first motion event. **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `tests/test_cursor_hidden_linux.py:22`: The test runner is forced to use gcc instead of its configured C compiler. (more on the line) **Do:** Declare the runner's {cc} placeholder and use the configured compiler for direct invocation as well. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The SDL2 cursor path has not been exercised in the game. *When:* A Linux player using SDL2 takes a different cursor API and relative-mouse path from the tested SDL3 setup. **Do:** Run the hide, mouse restore, menu and capture transitions with SDL2 on Linux. - **L4**: The reported KDE Wayland environment and Steam Deck game mode have not been exercised. *When:* The fix changes cursor visibility and mouse handling on these Linux compositor and input paths, including Deck trackpad and touchscreen input. **Do:** Run the reported controller and mouse sequence on KDE Wayland, and verify built-in controls, trackpad and touchscreen in Deck game mode. `@fix` can do L1 and L2. **Checks:** Still running: 9 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, for the reported controller case on the tested SDL3 setup: the author observed the cursor hide on controller input and return on a real mouse move. SDL2 and the reporter's KDE Wayland setup remain untested. **Other systems:** The new SDL adapter is compiled on Windows but called by the Linux window only. SDL2, KDE Wayland, and Steam Deck game mode can follow different cursor and input paths and have no reported game run; the SDL3 GNOME Wayland run is positive. The input timestamp is read through the existing interlocked accessor. **Switches:** None. **Reviewed:** 5437658d73bb against 8aa5ab876d7c: Read the diff, commit, repository rules and PR template, changed cursor code and test, and the surrounding SDL event loop, input timestamp, capture, and test-runner paths. Skimmed the remainder of the large SDL adapter, pointer fixture, and standards; docs/review-checklist.md and the adjacent Tooling checkout were absent. No generated files or recorded runs were changed.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance. - No game-derived files, generated files, switches, or renderer API changes appear in the diff. - The SDL calls are made on the window thread, and the player-input timestamp uses the existing interlocked accessor. - The authored SDL3 game run demonstrates the principal controller hide and mouse restore behavior. **Testing:** No commands from the project were run, as requested. The author reports an SDL3 game run and game-free test results; CI is still running. **Overlaps and merge order:** Not determined from the supplied checkout and PR data. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -92,0 +107,4 @@
}
/* a move to (x, y): from the last point a move counted at, any other point while shown, more than 4 units away while hidden */
static void gm_mouse_moved(float x, float y) {
if (gm_rebase) {
Member

L1 (blocking): The first real mouse movement is discarded if no motion event has established the initial point.

When: Start with the pointer already over the window, use a controller before moving the mouse, then move the mouse: the controller hides the cursor, but gm_rebase causes that first movement to return without showing it. The player must move it again.

Do: Establish the initial point from the current SDL mouse position when the window is created, and add a test that hides the cursor before the first motion event.

**L1** (blocking): The first real mouse movement is discarded if no motion event has established the initial point. *When:* Start with the pointer already over the window, use a controller before moving the mouse, then move the mouse: the controller hides the cursor, but gm_rebase causes that first movement to return without showing it. The player must move it again. **Do:** Establish the initial point from the current SDL mouse position when the window is created, and add a test that hides the cursor before the first motion event.
@ -0,0 +19,4 @@
sys.path.insert(0, str(Path(__file__).resolve().parent)) # (tests/srccut.py: python -I leaves this folder off the path)
from srccut import between, block # noqa: E402
RUN_ALL_ARGS = ["--cc", "gcc"]
Member

L2 (should fix): The test runner is forced to use gcc instead of its configured C compiler.

When: On a supported machine with Clang configured through CC but no gcc on PATH, run_all skips this test, or fails it in strict mode, even though a usable compiler is available.

Do: Declare the runner's {cc} placeholder and use the configured compiler for direct invocation as well.

**L2** (should fix): The test runner is forced to use gcc instead of its configured C compiler. *When:* On a supported machine with Clang configured through CC but no gcc on PATH, run_all skips this test, or fails it in strict mode, even though a usable compiler is available. **Do:** Declare the runner's {cc} placeholder and use the configured compiler for direct invocation as well.
Owner
@fix
BeanBot force-pushed fix/linux-cursor-hide from 5437658d73
Some checks failed
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 8s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 91462d1a28
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Successful in 11s
CI / Third-party parts and guide screenshots (pull_request) Failing after 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 12s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m13s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m20s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m30s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m19s
CI / Website build and checks (pull_request) Successful in 1m40s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 29m13s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 41m2s
2026-11-28 05:13:25 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The reported SDL3 game run shows the cursor behavior working on GNOME Wayland. The SDL2, KDE Wayland and Steam Deck game-mode runs remain outstanding. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 91462d1a28. I rebased it onto main (c7cb5eab38). I edited its description to match the change.

Changed

  • Initial mouse position in host/posix/display_sdl.c:111: Initialize the cursor position from SDL before the event loop and add a regression test for controller input before the first motion in tests/test_cursor_hidden_linux.py:48. Tests were not run, as requested.
  • Configured compiler in tests/test_cursor_hidden_linux.py:23: Use the runner's {cc} placeholder and honor CC for direct invocation, defaulting to cc.

Nothing was built or run: the checks run again on the new head.

The change hides the Linux game-window cursor during controller or keyboard play and restores it on mouse use. The follow-up initializes the mouse position before the event loop and lets the test use the configured C compiler.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The SDL2 cursor path has not been exercised in the game. When: A Linux player using SDL2 takes a different cursor API and relative-mouse path from the tested SDL3 setup. Do: Run the hide, mouse restore, menu and capture transitions with SDL2 on Linux.
  • L4: The reported KDE Wayland environment and Steam Deck game mode have not been exercised. When: The fix changes cursor visibility and mouse handling on these Linux compositor and input paths, including Deck trackpad and touchscreen input. Do: Run the reported controller and mouse sequence on KDE Wayland, and verify built-in controls, trackpad and touchscreen in Deck game mode.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (3; not asked for, not blocking)
  • A resize still deliberately rebases on the next motion, so a real first motion after a resize can be discarded.
  • The Windows host build remains listed as untested.
  • The supplied base-to-HEAD diff includes many changes beyond the five files described by the pull request.
More: does it help, other systems, switches, what was read

Does it help: Yes: the reported SDL3 game run hid the cursor on controller input and restored it on a real mouse move. The latest initialization change has not been reported tested in game.

Other systems: SDL2 and SDL3 use different cursor calls; only SDL3 has a reported game run. KDE Wayland and Steam Deck game mode remain untested. Windows compiles the SDL wrapper but does not call the new cursor function; its build is awaiting CI or a manual run.

Switches: None.

Reviewed: 91462d1a28 against c7cb5eab38: Read AGENTS.md, CONTRIBUTING.md, the fix diff, the cursor change diff, and tests/test_cursor_hidden_linux.py. Read the relevant display loop, SDL mouse-position wrapper and test-runner references. The supplied base-to-HEAD diff contains 1,492 files and was not read in full; it includes many commits beyond the described five-file pull request. The pull request template and remaining changed files were not read in full.; nothing run (a code review).

Checked and fine:

  • The mouse position is initialized after window creation and before the event loop.
  • The test runner passes its configured C compiler through the {cc} placeholder.
  • The follow-up retains the cursor-hiding behavior.

Testing: No commands that build or run project code were executed. The description reports an SDL3 game run and earlier game-free test results; CI has not yet run on the latest head.

Overlaps and merge order: Not checked.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The reported SDL3 game run shows the cursor behavior working on GNOME Wayland. The SDL2, KDE Wayland and Steam Deck game-mode runs remain outstanding. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 91462d1a28a1. I rebased it onto `main` (c7cb5eab3872). I edited its description to match the change. **Changed** - **Initial mouse position in host/posix/display_sdl.c:111**: Initialize the cursor position from SDL before the event loop and add a regression test for controller input before the first motion in tests/test_cursor_hidden_linux.py:48. Tests were not run, as requested. - **Configured compiler in tests/test_cursor_hidden_linux.py:23**: Use the runner's {cc} placeholder and honor CC for direct invocation, defaulting to cc. Nothing was built or run: the checks run again on the new head. The change hides the Linux game-window cursor during controller or keyboard play and restores it on mouse use. The follow-up initializes the mouse position before the event loop and lets the test use the configured C compiler. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The SDL2 cursor path has not been exercised in the game. *When:* A Linux player using SDL2 takes a different cursor API and relative-mouse path from the tested SDL3 setup. **Do:** Run the hide, mouse restore, menu and capture transitions with SDL2 on Linux. - **L4**: The reported KDE Wayland environment and Steam Deck game mode have not been exercised. *When:* The fix changes cursor visibility and mouse handling on these Linux compositor and input paths, including Deck trackpad and touchscreen input. **Do:** Run the reported controller and mouse sequence on KDE Wayland, and verify built-in controls, trackpad and touchscreen in Deck game mode. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - A resize still deliberately rebases on the next motion, so a real first motion after a resize can be discarded. - The Windows host build remains listed as untested. - The supplied base-to-HEAD diff includes many changes beyond the five files described by the pull request. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes: the reported SDL3 game run hid the cursor on controller input and restored it on a real mouse move. The latest initialization change has not been reported tested in game. **Other systems:** SDL2 and SDL3 use different cursor calls; only SDL3 has a reported game run. KDE Wayland and Steam Deck game mode remain untested. Windows compiles the SDL wrapper but does not call the new cursor function; its build is awaiting CI or a manual run. **Switches:** None. **Reviewed:** 91462d1a28a1 against c7cb5eab3872: Read AGENTS.md, CONTRIBUTING.md, the fix diff, the cursor change diff, and tests/test_cursor_hidden_linux.py. Read the relevant display loop, SDL mouse-position wrapper and test-runner references. The supplied base-to-HEAD diff contains 1,492 files and was not read in full; it includes many commits beyond the described five-file pull request. The pull request template and remaining changed files were not read in full.; nothing run (a code review). **Checked and fine:** - The mouse position is initialized after window creation and before the event loop. - The test runner passes its configured C compiler through the {cc} placeholder. - The follow-up retains the cursor-hiding behavior. **Testing:** No commands that build or run project code were executed. The description reports an SDL3 game run and earlier game-free test results; CI has not yet run on the latest head. **Overlaps and merge order:** Not checked. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/linux-cursor-hide 2026-11-28 05:14:08 +00:00
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Successful in 11s
CI / Third-party parts and guide screenshots (pull_request) Failing after 13s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 12s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 2m13s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 4m20s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m30s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 5m19s
CI / Website build and checks (pull_request) Successful in 1m40s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 29m13s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 41m2s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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
MagicBeanDev/Longshot!2440
No description provided.