lifecycle: do not latch MOUSE_DRAGGING on WM_NCLBUTTONDOWN #524

Open
aowu wants to merge 1 commit from aowu/Darner:pr/fix-titlebar-drag-lock into Main
First-time contributor

Problem

window_proc currently handles WM_ENTERSIZEMOVE | WM_NCLBUTTONDOWN in the same arm, setting MOUSE_DRAGGING = true and releasing mouse capture.

Clicking the title bar or window chrome (e.g. a quick click without dragging) sends WM_NCLBUTTONDOWN, which does not always enter a size/move loop or emit WM_EXITSIZEMOVE. When that happens, MOUSE_DRAGGING stays latched true until a client-area left click arrives.

Fix

Handle WM_NCLBUTTONDOWN separately so it still releases mouse capture (capture_mouse(hwnd, false)), while only WM_ENTERSIZEMOVE latches MOUSE_DRAGGING = true (paired cleanly with WM_EXITSIZEMOVE).

Verification

  • cargo test -p darner-hle --lib lifecycle passes (22/22).
### Problem `window_proc` currently handles `WM_ENTERSIZEMOVE | WM_NCLBUTTONDOWN` in the same arm, setting `MOUSE_DRAGGING = true` and releasing mouse capture. Clicking the title bar or window chrome (e.g. a quick click without dragging) sends `WM_NCLBUTTONDOWN`, which does not always enter a size/move loop or emit `WM_EXITSIZEMOVE`. When that happens, `MOUSE_DRAGGING` stays latched `true` until a client-area left click arrives. ### Fix Handle `WM_NCLBUTTONDOWN` separately so it still releases mouse capture (`capture_mouse(hwnd, false)`), while only `WM_ENTERSIZEMOVE` latches `MOUSE_DRAGGING = true` (paired cleanly with `WM_EXITSIZEMOVE`). ### Verification - `cargo test -p darner-hle --lib lifecycle` passes (22/22).
Owner

Test needed — commit 01487874; what to check: the change described above

Evidence 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 testing to take this run; it's free again after 24 h with no results.

**Test needed** — commit `01487874`; what to check: the change described above Evidence 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 `testing` to take this run; it's free again after 24 h with no results.
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 'pr/fix-titlebar-drag-lock:aowu-pr/fix-titlebar-drag-lock'
git switch 'aowu-pr/fix-titlebar-drag-lock'

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 'aowu-pr/fix-titlebar-drag-lock'
git switch 'aowu-pr/fix-titlebar-drag-lock'
git rebase 'Main'
git switch 'Main'
git merge --ff-only 'aowu-pr/fix-titlebar-drag-lock'
git switch 'aowu-pr/fix-titlebar-drag-lock'
git rebase 'Main'
git switch 'Main'
git merge --no-ff 'aowu-pr/fix-titlebar-drag-lock'
git switch 'Main'
git merge --squash 'aowu-pr/fix-titlebar-drag-lock'
git switch 'Main'
git merge --ff-only 'aowu-pr/fix-titlebar-drag-lock'
git switch 'Main'
git merge 'aowu-pr/fix-titlebar-drag-lock'
git push origin 'Main'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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
TrustNo1/Darner!524
No description provided.