Skip to content

desktop: pointer input accepts points off the screen, and X wraps values above 32767 #424

Closed

Description

@ElbertePlinio

Desktop pointer commands accept any non-negative integer coordinate (assertCoordinate in packages/desktop-linux/src/input.ts). X then changes points the session cannot hold:

  • A point past the screen edge moves to the edge. click 2000 100 on a 640x480 session clicks at 639,100.
  • A value above 32767 wraps, because X11 coordinates are 16-bit. On a private 640x480 Xvfb, click 32768 100 clicked at 0,100 and click 65537 100 at 1,100.

In both cases the command succeeds, so an agent that sends a wrong coordinate clicks a different point than it asked for and gets no error. The wrap is the worse case, since it lands on the opposite side of the screen.

Found while reviewing the click pulse for #368. The pulse follows the edge move, and a wrapped click shows no pulse.

  • Refuse pointer coordinates outside the session size with a clear error, for click, double click, move, drag and scroll, in the CLI and MCP
  • Test the edge and the 16-bit wrap

Activity

  1. ElbertePlinio commented on Oct 28, 2026

    @ElbertePlinio
    MemberAuthor

    Found in the review of PR #425 (#368).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions