fix(input): stop dividing touch/tablet bridge coords by output scale (#47) #93

Merged
albert merged 1 commit from u/albert/47/touch-compat-scale-offset into main 2026-07-12 18:35:03 +00:00
Owner

The absolute pointer/touchscreen the input bridges synthesize declares a
0..=65535 range that libinput maps onto the output's logical layout
space, so a full-pad sweep already tracks the finger 1:1 at any output
scale. The output-scale division added in #58 was therefore wrong in
principle; it only ever looked correct because it was solely exercised
with the XWayland HiDPI workaround forcing scale to 1.0, where the divide
is a no-op. On a scaled output without that workaround (Scratch at output
scale 1.5) it offset the synthesized cursor — issue #47.

Remove the correction from both bridges: rescale_abs no longer takes a
scale, new_absolute()/new_touchscreen() drop the output_scale parameter,
the --output-scale CLI flag is gone from the touch and tablet bridges,
and the host no longer queries the sway scale or passes it through.
Confirmed 1:1 end-to-end against the live Scratch repro (edge-to-edge
drag plus corner/center taps). The tablet bridge fix has no live repro
(no tablet on hand) but follows the same reasoning and needs re-testing
on real hardware.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01MYSRycxV3iG9PHjHqArLjg

Fixes #47 (for real this time, validated with the XWayland hack both on and off)

The absolute pointer/touchscreen the input bridges synthesize declares a 0..=65535 range that libinput maps onto the output's *logical* layout space, so a full-pad sweep already tracks the finger 1:1 at any output scale. The output-scale division added in #58 was therefore wrong in principle; it only ever looked correct because it was solely exercised with the XWayland HiDPI workaround forcing scale to 1.0, where the divide is a no-op. On a scaled output without that workaround (Scratch at output scale 1.5) it offset the synthesized cursor — issue #47. Remove the correction from both bridges: rescale_abs no longer takes a scale, new_absolute()/new_touchscreen() drop the output_scale parameter, the --output-scale CLI flag is gone from the touch and tablet bridges, and the host no longer queries the sway scale or passes it through. Confirmed 1:1 end-to-end against the live Scratch repro (edge-to-edge drag plus corner/center taps). The tablet bridge fix has no live repro (no tablet on hand) but follows the same reasoning and needs re-testing on real hardware. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MYSRycxV3iG9PHjHqArLjg Fixes #47 (for real this time, validated with the XWayland hack both on and off)
fix(input): stop dividing touch/tablet bridge coords by output scale (#47)
All checks were successful
CI / Version harmony (pull_request) Successful in 49s
CI / Arch neutrality (pull_request) Successful in 50s
CI / ShellCheck (pull_request) Successful in 53s
CI / CI image (pull_request) Successful in 51s
CI / CI image (Android) (pull_request) Successful in 26s
CI / CI images (pull_request) Successful in 0s
CI / Rustfmt (pull_request) Successful in 1m1s
CI / Clippy (pull_request) Successful in 5m43s
CI / Build (pull_request) Successful in 7m29s
CI / E2E (pull_request) Successful in 9m13s
CI / Test (pull_request) Successful in 9m16s
CI / Android companion (unit tests) (pull_request) Successful in 1m51s
CI / Firewall E2E (pull_request) Successful in 4m30s
CI / Android media (cargo-ndk build) (pull_request) Successful in 2m15s
CI / Package (.deb smoke build) (pull_request) Successful in 10m53s
78e69bd4af
The absolute pointer/touchscreen the input bridges synthesize declares a
0..=65535 range that libinput maps onto the output's *logical* layout
space, so a full-pad sweep already tracks the finger 1:1 at any output
scale. The output-scale division added in #58 was therefore wrong in
principle; it only ever looked correct because it was solely exercised
with the XWayland HiDPI workaround forcing scale to 1.0, where the divide
is a no-op. On a scaled output without that workaround (Scratch at output
scale 1.5) it offset the synthesized cursor — issue #47.

Remove the correction from both bridges: rescale_abs no longer takes a
scale, new_absolute()/new_touchscreen() drop the output_scale parameter,
the --output-scale CLI flag is gone from the touch and tablet bridges,
and the host no longer queries the sway scale or passes it through.
Confirmed 1:1 end-to-end against the live Scratch repro (edge-to-edge
drag plus corner/center taps). The tablet bridge fix has no live repro
(no tablet on hand) but follows the same reasoning and needs re-testing
on real hardware.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MYSRycxV3iG9PHjHqArLjg
albert merged commit f8b238719a into main 2026-07-12 18:35:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
albert/shepherd-launcher!93
No description provided.