gameinput: let go of the cursor clip while the window is dragged (RT-GAMEINPUT-CLIP-DRAG) #2487
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!2487
Loading…
Reference in a new issue
No description provided.
Delete branch "rt-gameinput-clip-drag"
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?
Pull request successfully merged and closed
Claimed in the coordination issue as: RT-GAMEINPUT-CLIP-DRAG (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7225229818). It comes from a user's report: when you grab the window, it is pulled downwards on the monitor instead of being dragged. Thanks for the report.
Depends on: none.
What and why
With raw input on, the keyboard pad keeps the cursor inside the foreground window's client area.
clip_cursor()inruntime/shims/gameinput.cppcallsClipCursoron the client rect and repeats it every 100 ms while the window has focus. A press on the title bar (non-client area) was pulled into the client area. During the modal move loop that followed, each re-clip pulled the cursor down again, and the window followed it down the screen. The twoSetWindowPoscalls (d3d12_xs_device.cpp,dxgi_com.cpp) already passSWP_NOMOVE, so they are not the cause.The clip is now released (
ClipCursor(nullptr)) in these cases:GetGUIThreadInfo:GUI_INMOVESIZE,GUI_INMENUMODE,GUI_SYSTEMMENUMODE).A press in the client area keeps the clip, so a click still cannot land on another window, as before. The clip comes back once the button is released and the loop has ended.
The decision is a pure helper,
rt::gameinput::detail::CursorClipGate(newruntime/shims/gameinput_clip.h). It takes "wanted", "modal loop", "button down" and "cursor in client", and returns whether to clip now.clip_cursor()reads those four inputs from Windows and applies the result.docs/gameinput.mddescribes the new release cases.Tested
gameinput_cliptest (runtime/test/gameinput_clip_test.cpp, no window, no SDL). It covers:gameinput,gameinput_script,gameinput_hostandgameinput_clippass in an SDL3 build.gameinput_no_sdl,gameinput_no_sdl_script,gameinput_hostandgameinput_clippass in a build without SDL3.No game files, logs or screenshots.
GPUs tested: profile M: NVIDIA GeForce RTX 4070 SUPER, 12 GB, desktop, driver 621.01, Windows 11
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code
Reviewed at head
28829e0aaon Windows 11 (MSVC 202219.44).Verification
gameinput_clip_test.gameinput_clip_test: passed.Notes (non-blocking)
gameinput_clip.h:10-30) and polling-path suppression on move/size/menu flags (gameinput.cpp:1793-1816,1905,2039-2045) are clean and well-tested.docs/gameinput.md:164-168;gameinput.cpp:1793-1825): Once a client-areaClipCursorhas already settled with no active move/menu loop, Windows constrains the cursor inside the client rectangle so a user cannot reach the title bar or resize border to initiate an outside-client click. This change cleanly handles drags already in progress (e.g., activation drags or system-menu Move); clarifying the supported entry paths indocs/gameinput.mdwould set accurate expectations.Approve.
AI-assisted review + local MSVC verification.
Merged into
main(merge commit 766963e34), approved by DadaCap (maintainer). Thanks!Checked before merging: Its new test
gameinput_clippasses with main merged in, and the existinggameinputtest still passes. The merge was pinned to the head commit that was tested (28829e0aa).AI-assisted (Claude Code), posted for DadaCap.
Verified by OreoFR
09c153948+ PR head28829e0aa; integration package 6 of 6 (1 PR, merged without conflict)AI-assisted (Claude Code, Claude Opus 5.5).