Fix touch/mouse bridge offset #134
No reviewers
Labels
No labels
bug
duplicate
enhancement
future
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
albert/shepherd-launcher!134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/touch-bridge-grabs-clickpad"
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?
On a Legion Go S, touch-to-mouse mapped roughly the top-left quarter of the
panel to the whole screen, with everything past it pinned at the edge. Two
defects compounded:
looks_like_touchscreen()tested only for BTN_TOUCH plus absolute X/Y axes.Clickpads report exactly that, so the handheld's touchpad (INPUT_PROP_POINTER
| INPUT_PROP_BUTTONPAD, range 0..400) was grabbed alongside the real
0..1920x0..1200 panel. And
mainkept a single DeviceRange -- whicheverdevice opened first -- and applied it to every reader's raw coordinates. The
panel normalized against 0..400 saturates after 20.8% of its width and 33% of
its height.
Which device opens first is arbitrary: evdev::enumerate() is a bare read_dir
with no sorting, so the panel winning the race was luck. It held until a
session switch re-probed the USB device and moved the touchpad from event6 to
event10.
Require the device to be direct -- INPUT_PROP_DIRECT, or claiming neither
INPUT_PROP_POINTER nor BTN_TOOL_FINGER -- mirroring how udev's input_id
builtin classifies these, with the fallback keeping panels that omit the
property working. The rule is a pure function over a TouchCaps struct so it is
testable without a real device node.
Independently, carry already-normalized coordinates in TouchUpdate so each
device is scaled against its own range. The reader thread already had that
range; it just wasn't using it. This makes the enumeration-order dependence
structurally impossible rather than merely unlikely.
The tablet bridge carried an identical copy of the shared-range defect (not
the filter one -- it excludes INPUT_PROP_DIRECT by design, since it re-maps
indirect devices). Fixed the same way, but with no tablet hardware to hand
tablet_to_touch still wants re-testing on a real device.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
fix/touch-bridge-grabs-clickpadto Fix touch/mouse bridge offset