Skip to content

feat(control): opt-in input tracing to locate mis-placed clicks - #50

Merged
mrprecioustech merged 1 commit into
masterfrom
debug/input-tracing
Aug 10, 2026
Merged

feat(control): opt-in input tracing to locate mis-placed clicks#50
mrprecioustech merged 1 commit into
masterfrom
debug/input-tracing

Conversation

@mrprecioustech

Copy link
Copy Markdown
Contributor

Whether the pointer has actually arrived by the time a button event is
delivered depends on when the OS applies a synthetic move. That is not
knowable from the code, so this adds the measurement.

PAIRUX_DEBUG_INPUT=1 records, per button event: the normalized coordinates,
the absolute pixels requested, the position read back from the OS immediately
before the press, and the drift between them. Non-zero drift means the settle
delay added in #49 is too short and the click is landing somewhere other than
where the guest aimed.

Also logs nut-js's screen geometry at init — the other half of a mis-placed
click. If that disagrees with the display's real geometry (Retina reporting
physical pixels where setPosition wants logical points), every coordinate is
scaled wrong and no delay fixes it.

On the injector side it records the two-cursor bookkeeping around each click,
so a restore firing between a down and its up — which would yank the pointer
mid-click, and is invisible in the backend's own trace — shows up.

Off unless explicitly set to "1": it costs a window-server round trip per
button event and prints the coordinates of everything the remote peer clicks.
Shipping it disabled-by-default so a host hitting this can produce a log
without needing a custom build.

The remaining click failure cannot be diagnosed by reading the code. Whether
the pointer has actually arrived by the time a button event is delivered
depends on when the OS applies a synthetic move, which is only observable at
runtime.

Adds PAIRUX_DEBUG_INPUT=1 tracing that records, per button event, the
normalized coordinates, the absolute pixels we asked for, the position read
back from the OS immediately before the press, and the drift between them.
Non-zero drift means the settle delay is too short and the click is landing
somewhere other than where the guest aimed.

Also logs nut-js's screen geometry at init, which is the other half of a
mis-placed click: if that disagrees with the display's real geometry — Retina
reporting physical pixels where setPosition wants logical points — every
coordinate is scaled wrong and no delay fixes it.

On the injector side it records the two-cursor bookkeeping around each click,
so a restore firing between a down and its up (which would yank the pointer
mid-click, and is invisible in the backend's own trace) shows up.

Off unless explicitly set to "1": it costs a window-server round trip per
button event and prints the coordinates of everything the remote peer clicks.
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

160 finding(s)

HIGH/CRITICAL: 5 | MEDIUM: 49 | LOW: 106

Severity Rule Location
HIGH secret-generic-credential apps/livekit/fly.toml:12
HIGH manifest-typosquat apps/mobile/package.json:43
HIGH secret-generic-credential apps/turn/fly.toml:11
HIGH secret-generic-credential docs/API.md:648
HIGH secret-generic-credential docs/API.md:654
MEDIUM insecure-temp-file apps/desktop/src/main/streaming/index.test.ts:64
MEDIUM sql-template-interpolation apps/desktop/src/renderer/components/capture/CameraBubble.tsx:129
MEDIUM insecure-temp-file apps/installer/scripts/install.sh:370
MEDIUM insecure-temp-file apps/installer/scripts/install.sh:393
MEDIUM insecure-temp-file apps/installer/scripts/install.sh:402
MEDIUM insecure-temp-file apps/installer/scripts/install.sh:438
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:48
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:73
MEDIUM js-unescaped-html-sink apps/web/src/app/c/[handle]/page.tsx:191
MEDIUM js-unescaped-html-sink apps/web/src/app/l/[joinCode]/page.tsx:165
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:128
MEDIUM js-unescaped-html-sink apps/web/src/app/live/page.tsx:145
MEDIUM js-unescaped-html-sink apps/web/src/app/page.tsx:122
MEDIUM js-unescaped-html-sink apps/web/src/app/pricing/page.tsx:284
MEDIUM js-open-redirect apps/web/src/app/pricing/UpgradeButton.tsx:50
MEDIUM js-unescaped-html-sink apps/web/src/app/u/[username]/page.tsx:282
MEDIUM manifest-install-lifecycle-script package.json:54
MEDIUM sql-template-interpolation packages/ai-core/src/prompts.ts:36
MEDIUM insecure-temp-file packages/remote-input/src/backends/waylandYdotool.test.ts:81
MEDIUM insecure-temp-file packages/remote-input/src/backends/waylandYdotool.test.ts:96
MEDIUM insecure-temp-file packages/remote-input/src/backends/waylandYdotool.test.ts:112
MEDIUM insecure-temp-file packages/remote-input/src/backends/waylandYdotool.test.ts:132
MEDIUM insecure-temp-file packages/remote-input/src/backends/waylandYdotool.test.ts:152
MEDIUM insecure-temp-file packages/remote-input/src/backends/waylandYdotool.test.ts:178
MEDIUM insecure-temp-file packages/remote-input/src/backends/waylandYdotool.test.ts:200
MEDIUM sql-template-interpolation scripts/lib/package-managers/apt.ts:55
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/apt.ts:154
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/apt.ts:160
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/apt.ts:208
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/apt.ts:313
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/aur.ts:310
MEDIUM sql-template-interpolation scripts/lib/package-managers/aur.ts:341
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/aur.ts:341
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/chocolatey.ts:264
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/chocolatey.ts:288
MEDIUM sql-template-interpolation scripts/lib/package-managers/gentoo.ts:274
MEDIUM sql-template-interpolation scripts/lib/package-managers/homebrew.ts:152
MEDIUM sql-template-interpolation scripts/lib/package-managers/nix.ts:225
MEDIUM sql-template-interpolation scripts/lib/package-managers/rpm.ts:55
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/rpm.ts:201
MEDIUM js-shell-exec-interpolation scripts/lib/package-managers/rpm.ts:261
MEDIUM sql-template-interpolation scripts/lib/package-managers/scoop.ts:145
MEDIUM js-shell-exec-interpolation scripts/release.mjs:145
MEDIUM js-shell-exec-interpolation scripts/release.mjs:146
MEDIUM js-shell-exec-interpolation scripts/release.mjs:147

…and 110 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@mrprecioustech
mrprecioustech merged commit 1a5d385 into master Aug 10, 2026
13 checks passed
@mrprecioustech
mrprecioustech deleted the debug/input-tracing branch August 10, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant