[pr-fix][input] Window drag: a title bar click that moves nothing ends it, and the native mouse waits for the move to end #421
Loading…
Reference in a new issue
No description provided.
Delete branch "elgibbone/window-drag-capture"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What it changes
WM_NCLBUTTONDOWNsetsMOUSE_DRAGGING, and onlyWM_EXITSIZEMOVE, a click in the window, a lost focus or a deactivation clear it. A press on the title bar with no drag, or on the minimise or maximise button, sends noWM_EXITSIZEMOVE. On the legacy path (DARNER_NATIVE_MOUSE=0) the capture then stays off andmnk::samplereturns an empty pad, keys included, until the next click in the window.should_capture_mousedoesn't look at the drag. A click on the title bar of the unfocused window focuses it, the next 8 ms poll captures, and the cursor clip (also renewed byrefresh_cursor_clipon everyWM_MOVE) can pull the cursor off the title bar into the window while the move goes on.What this does:
WM_NCLBUTTONDOWNstill sets the flag. It is what frees the cursor when the click that activates the window lands on the title bar. The system's move and size loop runs inside the default handling of that message, so once the title's procedure returns from it the drag is over. If noWM_EXITSIZEMOVEcleared the flag by then,window_procclears it there and takes the legacy capture back, asWM_EXITSIZEMOVEdoes.should_capture_mousetakesdragging(lifecycle::mouse_dragging()), in the overlay poll and in the F9 toggle. The native mouse is not captured while the window is moved or sized, and comes back on the first poll after.native mouse capture changesline logsdraggingwith the other reasons.I didn't set the flag only between
WM_ENTERSIZEMOVEandWM_EXITSIZEMOVE. Without the flag onWM_NCLBUTTONDOWN, the activation's capture would clip the cursor away from the title bar the player is holding.How it was tested
aac6fbf(one commit on mainf3840d7)menu_and_pause_states_release_and_recapture_mousecovers the newdraggingargument.cargo clippy --workspace --all-targets --locked -- -D warningsclean, the same with--all-featuresclean,cargo xtask policypassed,cargo test -p darner-hle --locked496 passed, 0 failed, 15 ignored,cargo test -p darner --locked160 passed, 1 ignored. Not the wholecargo test --workspace.WM_NCLBUTTONDOWN, the move loop) is read from the code and the Win32 documentation, not driven by a test.Checklist
main.docs/asset-policy.md.Checked for overlap
lifecycle.rs, and #364, #399, #402 and #405 also changegameinput.rs; this merges with each of them without conflicts (git merge-tree). #75 also changeslifecycle.rs, but already conflicts withmainthere on its own.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.