Repository navigation
fix(desktop): refuse pointer points outside the live screen - #437
Merged
Merged
Conversation
X moves a point past the screen edge to the edge and wraps a value above 32767, so a click could land on a different point and still succeed. Pointer input now checks every point against the screen size in the verified session record and refuses it before dispatch. A record without a size refuses pointer input. The refusal extends DesktopInputTargetError, so CLI and MCP evidence record it as not attempted and no click pulse fires. Closes #424
Read the default screen's current width and height from the X11 setup reply over the verified socket, after the ownership check and within its 3 s budget. The session record only holds the size at creation, so a RandR resize or a wrong record no longer widens the allowed area. When the size cannot be read, pointer input is refused before dispatch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Desktop pointer input now refuses a point outside the session's screen before anything is sent. Before this change, X moved a point past the edge to the edge and wrapped values above 32767, so
click 32768 100on a 640x480 session clicked at 0,100 and succeeded.The bounds come from the live Xvfb, not the session record. After the ownership check, pointer input opens the verified X11 socket and reads the default screen's current size from the setup reply, within the same 3 s budget. Sessions run Xvfb with
-noreset, so a new connection sees a RandR resize. A forged or stale record cannot widen the allowed area. When the size cannot be read, input is refused. A refusal usesDesktopPointerOutOfBoundsError, aDesktopInputTargetError, so evidence records it as not attempted and the click pulse does not fire. Key presses, scroll without a point and pointer markers open no extra connection.Closes #424
424/before-old-code.log,424/after-new-code.logpointer-target.test.ts,pointer-bounds-live.test.ts424/round2/after-new-code.logxrandr --fb 320x240shrink; record set to 40000x40000; server stopped with SIGSTOP424/round2/before-old-code.log424/round2/qa.sh,424/round2/qa-cli-output.txtEvidence paths are under
~/.pickforge/investigations/on the review host.CI has no
xrandr:ci.ymlinstallsx11-utils, and xrandr is inx11-xserver-utilson Ubuntu. The live shrink test skips there; the forged-record and unreadable-size live tests need only Xvfb and xdotool and run in CI.Sol review, round 1: 6/10, one blocker, that the bounds came from the session record. Fixed in d96a659 with the live screen read. Round 2: 6/10, one should: a RandR resize in the few milliseconds between the size read and the xdotool connection can still move an on-screen point to the new edge. Declined: the same window already exists for a server that replaces the owned Xvfb before xdotool connects, and closing both needs dispatch through our own connection under a server grab instead of xdotool. 7e68bb3 documents the window next to the existing note.
Checks on 4b0223c: oxlint, typecheck, build; full vitest coverage run with the desktop, window, wait, browser and viewer requirements on (3440 passed, 4 skipped; two unrelated CLI tests timed out at the 5 s default at load average 18 and passed on rerun, filed as #436);
PICKFORGE_REQUIRE_XVFB=1 cargo test --workspace --locked(328 passed). 7e68bb3 changes only a comment. PickCheck 0.4.0 against main is clean.