Skip to content

backends/x11: Fetch the tablet serial prop on device add

Peter Hutterer requested to merge whot/mutter:wip/libinput-driver-serials into main

For tablet device, the tool was created when the "Wacom Serial IDs" prop changed values. This property does not exist on the xf86-input-libinput driver but v1.5.0 of that driver has a different property for the serial.

The serial is constant (the driver creates one X device per serial), so we can fetch it after device creation and set it then. For earlier versions of the driver we assign the random serial 0xffffffaa - good enough to have at least a tool.

This fixes the crash in #3120 (closed) - clutter_event_motion_new() overrides event->device to the tool's device (if any). Without a tool motion events use the Virtual Core Pointer instead and our source device is never added to the stage's priv->pointer_devices.

When we generate an crossing event (which uses the source device) we fall afoul of an assert in clutter_stage_update_device() that expects our source device to be in priv->pointer_devices.

Fixes #3120 (closed)

See xf86-input-libinput!50 for the MR that adds the properties.

Edited by Peter Hutterer

Merge request reports