Window drag: a title bar click that moves nothing ends it, and the native mouse waits for the move to end #421
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!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.aac6fbfd26to52ab29c2f2Rebased onto main (
c8258f95) to clear the conflict.The only conflict was in
gameinput.rs, with #399 (now merged): both add a field to thenative mouse capture changeslog inhost::overlay, and #399 now derivesin_menufrommenu_cause. Both are kept,menu_causefrom #399 anddraggingfrom this PR. Nothing else changed: the diff is the same as before (gameinput.rsandlifecycle.rs, +31/-9).Checks on Windows (RTX 4070 Ti, Ryzen 7 7800X3D) at
52ab29c:cargo clippy --workspace --all-targets --locked -- -D warnings: cleancargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo test --locked -p darner-hle: 512 passed, 0 failed, 15 ignored (includesmenu_and_pause_states_release_and_recapture_mouse)cargo test --locked -p darner: 220 passed, 0 failed, 1 ignoredcargo xtask policy: okThe full
cargo test --workspacewas not run for this update.Generated by Claude Code
[pr-fix][input] Window drag: a title bar click that moves nothing ends it, and the native mouse waits for the move to endto Window drag: a title bar click that moves nothing ends it, and the native mouse waits for the move to endTest needed — commit
52ab29c2; what to check: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 tEvidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.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.