[PATCH xserver] man: Mention that InputClass overrides InputDevice.

Peter Hutterer peter.hutterer at who-t.net
Tue Aug 21 22:16:39 UTC 2018


On Tue, Aug 21, 2018 at 10:02:14AM +0200, Michal Srb wrote:
> To prevent confusion, since user may consider InputDevice as "stronger
> selector" and expect that it will take priority over InputClass.

I don't think this is correct, because the two are completely different.
InputClass will pick up any udev-added device it matches on. InputDevice
will just apply to that one device, with the side-effect that if you don't
exclude that explicit device from the InputClass section, you'll get a
duplicate device.

This is the case in the bug you linked:

 [    11.068] (II) XINPUT: Adding extended input device "Touchpad" (type: TOUCHPAD, id 6)
 [    11.372] (II) XINPUT: Adding extended input device "SynPS/2 Synaptics TouchPad" (type: TOUCHPAD, id 14)

xinput list should show both devices and general behaviour is going to be
odd because all events are now sent from both devices simultaneously. So
each click is a double-click, etc.

This all works with evdev because it has duplicate detection and refuses to
add the InputClass device (which always comes after the InputDevice due to
how the server works). synaptics doesn't have that because historically it
didn't need to. the libinput driver doesn't have that duplicate detection
either.

So nak to this patch, we'll need some more detail explaining this in the man
page. As the most simple general rule though: don't mix InputDevice and
InputClass.

Cheers,
   Peter

> ---
> Downstream reference:
> https://bugzilla.opensuse.org/show_bug.cgi?id=1105311
> 
>  hw/xfree86/man/xorg.conf.man | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
> index 958926243..c921a1487 100644
> --- a/hw/xfree86/man/xorg.conf.man
> +++ b/hw/xfree86/man/xorg.conf.man
> @@ -892,6 +892,10 @@ sections recognise some driver\-independent
>  which are described here.
>  See the individual input driver manual pages for a description of the
>  device\-specific options.
> +.B InputClass
> +sections which match this device will override the options specified in
> +.B InputDevice
> +section.
>  .TP 7
>  .BI "Option \*qAutoServerLayout\*q  \*q" boolean \*q
>  Always add the device to the ServerLayout section used by this instance of
> @@ -1022,7 +1026,11 @@ class of input devices as they are automatically added. An input device can
>  match more than one
>  .B InputClass
>  section. Each class can override settings from a previous class, so it is
> -best to arrange the sections with the most generic matches first.
> +best to arrange the sections with the most generic matches first. Options in
> +.B InputClass
> +sections override options from the device's backend, including those set in
> +.B InputDevice
> +section.
>  .PP
>  .B InputClass
>  sections have the following format:
> -- 
> 2.16.4


More information about the xorg-devel mailing list