[pr-diagnostics][input] Mouse capture log names the menu or pause condition that released it (#189) #399

Open
ElGibbone wants to merge 1 commit from elgibbone/menu-pause-cause into main AGit
First-time contributor

Refs #189

What it changes

  • The problem on main: the #189 log has native mouse capture changes want=false window_focused=true in_menu=true map_active=false at 03:58:29.388 and want=true ... in_menu=false at 03:58:34.557, while the player aimed and pressed Y on a shopkeeper. in_menu is one boolean for eleven conditions, so the log can't say which one the title raised.

is_menu_or_paused is split into menu_or_paused_cause, which returns the name of the first condition that holds (f1_menu, map, frontend, user_pause, menu_pause, sys_pause, no_local_player, hud_pause_menu, hud_shop_menu, extra_pause, modal) or None. is_menu_or_paused is now menu_or_paused_cause().is_some(): same reads, same order, same early return on the quick-select wheel. The native mouse capture changes line gets menu_cause=<name> (none when nothing holds), and the overlay poll takes in_menu from the same call, so the field and in_menu can't disagree.

Logging only: no behaviour or default changes. The next #189 log names the condition, and the fix follows from it.

How it was tested

  • Tested revision: 6029872 (on main f3840d7)
  • Commands and results: see the gates below.
  • Changes a default: no
  • A/B result: not applicable (a log field).
  • Gates run on that revision: cargo clippy --workspace --all-targets --locked -- -D warnings clean, the same with --all-features clean, cargo xtask policy passed, cargo test -p darner-hle --locked 496 passed, 0 failed, 15 ignored. Not the whole cargo test --workspace.
  • Gameplay, when relevant: not run in the game yet.
  • Hardware dependence: likely general.
  • Coverage gaps: no unit test, since every condition reads title memory.

Checklist

  • I ran this change in the game, or say below why it can't be (docs, tests only).
  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: #364 also changes gameinput.rs (keyboard bindings), not this code. No open PR changes mousehook.rs.
  • Replaces or overlaps: none found
Refs #189 ## What it changes - The problem on main: the #189 log has `native mouse capture changes want=false window_focused=true in_menu=true map_active=false` at 03:58:29.388 and `want=true ... in_menu=false` at 03:58:34.557, while the player aimed and pressed Y on a shopkeeper. `in_menu` is one boolean for eleven conditions, so the log can't say which one the title raised. `is_menu_or_paused` is split into `menu_or_paused_cause`, which returns the name of the first condition that holds (`f1_menu`, `map`, `frontend`, `user_pause`, `menu_pause`, `sys_pause`, `no_local_player`, `hud_pause_menu`, `hud_shop_menu`, `extra_pause`, `modal`) or `None`. `is_menu_or_paused` is now `menu_or_paused_cause().is_some()`: same reads, same order, same early return on the quick-select wheel. The `native mouse capture changes` line gets `menu_cause=<name>` (`none` when nothing holds), and the overlay poll takes `in_menu` from the same call, so the field and `in_menu` can't disagree. Logging only: no behaviour or default changes. The next #189 log names the condition, and the fix follows from it. ## How it was tested - Tested revision: 6029872 (on main f3840d7) - Commands and results: see the gates below. - Changes a default: no - A/B result: not applicable (a log field). - Gates run on that revision: `cargo clippy --workspace --all-targets --locked -- -D warnings` clean, the same with `--all-features` clean, `cargo xtask policy` passed, `cargo test -p darner-hle --locked` 496 passed, 0 failed, 15 ignored. Not the whole `cargo test --workspace`. - Gameplay, when relevant: not run in the game yet. - Hardware dependence: likely general. - Coverage gaps: no unit test, since every condition reads title memory. ## Checklist - [ ] I ran this change in the game, or say below why it can't be (docs, tests only). - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: #364 also changes `gameinput.rs` (keyboard bindings), not this code. No open PR changes `mousehook.rs`. - Replaces or overlaps: none found
The #189 log shows the native mouse capture released for 5.17 s in play
with the window focused and in_menu=true, but in_menu is one boolean for
eleven conditions. menu_or_paused_cause returns the first one that holds,
in the same order and with the same reads, and the "native mouse capture
changes" line logs it as menu_cause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/399/head:elgibbone/menu-pause-cause'
git switch 'elgibbone/menu-pause-cause'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'elgibbone/menu-pause-cause'
git switch 'elgibbone/menu-pause-cause'
git rebase 'main'
git switch 'main'
git merge --ff-only 'elgibbone/menu-pause-cause'
git switch 'elgibbone/menu-pause-cause'
git rebase 'main'
git switch 'main'
git merge --no-ff 'elgibbone/menu-pause-cause'
git switch 'main'
git merge --squash 'elgibbone/menu-pause-cause'
git switch 'main'
git merge --ff-only 'elgibbone/menu-pause-cause'
git switch 'main'
git merge 'elgibbone/menu-pause-cause'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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
TrustNo1/Darner!399
No description provided.