fix: stop the touchscreen and touchpad being grabbed as controller touchpads - #19
Merged
Conversation
…m also locking the touchpad and screen
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.
Summary
Fixes #18 — opening the drawer killed the machine's own touchscreen and touchpad
system-wide, while a stylus kept working.
classifyDevicetreated any device exposingABS_MT_POSITION_Xwith no gamepadbuttons as a PlayStation controller touchpad and
EVIOCGRAB-ed it whenever the drawerwas shown. The Z13's touchpad and touchscreen both match that test, so opening the
drawer took them away from the compositor entirely. The stylus survived only because it
reports pressure and tilt instead of multitouch slots — exactly the asymmetry in the
report — and
Escrestored input because dismissing ungrabs.This is not the GNOME overlay backend, which is where the issue thread first pointed it.
The grab is backend-independent, so @Pandry's KDE report is the same bug. It also only
bites users who can open those device nodes: stock udev grants the session user an ACL
on joysticks but not on touch devices, so
input-group members hit it and most peoplenever do.
Changes
classifynow requires a sibling gamepad. A multitouch device is only grab-onlywhen a gamepad from the same physical controller is already tracked. Every input node a
HID driver creates inherits bus/vendor/product from the parent
hid_device, so aDualSense touchpad always matches its own gamepad node, while
0b05:1a30(ASUStouchpad) and
04f3:43c7(ELAN panel) never can. PS touchpad suppression is preserved.INPUT_PROP_DIRECTdevices are rejected outright — a touchscreen is never acontroller touchpad. Deliberately not filtering on
INPUT_PROP_POINTERorINPUT_PROP_BUTTONPAD: the laptop touchpad reports both, and so do PS touchpads.uniq/physdisambiguate two controllers of the same model. A refinement only —mistaking one DualSense's touchpad for another's still grabs a controller touchpad.
scan()inspects everything before classifying anything./dev/input/event*enumerates in node order, not device order, and a controller's touchpad routinely comes
before its gamepad. Unmatched devices are left untracked so the 5s rescan re-evaluates
them once the controller appears.
classifyDeviceintoinspect()+ a pureclassify(). Classification took a*evdev.InputDeviceand could not be exercised without the hardware in hand; the purefunction is what makes the tests below possible.
docs/installation.mddescribing the symptom, why onlysome users saw it, and pointing at 1.4.1.
Testing
New
internal/gui/gamepad/gamepad_test.gois table-driven off the real capabilitysets transcribed from
/proc/bus/input/deviceson a GZ302EA — Z13 touchpad, ELANtouchscreen, ELAN stylus — plus DualSense gamepad/touchpad/motion nodes and the Steam
virtual pad. It covers the regression guard that matters: attaching a controller must not
resurrect the bug for the machine's own devices.
Verified before/after against the actual hardware, running as root so every node is
openable (the worst case):
Checklist
make buildpassesmake lintpasses (0 issues.)go test ./internal/theme/ -vpasses