#977996 xserver-xorg-input-libinput: for the middle button, reports press only when the button is released

Package:
xserver-xorg-input-libinput
Source:
xserver-xorg-input-libinput
Description:
X.Org X server -- libinput input driver
Submitter:
Vincent Lefevre
Date:
2020-12-24 02:57:03 UTC
Severity:
normal
#977996#5
Date:
2020-12-24 02:52:54 UTC
From:
To:
On my HP ZBook 15 G2 laptop, I have a pointstick with associated
mouse buttons and a touchpad with associated mouse buttons. There
is no issue with the touchpad buttons, but for the middle button
associated with the pointstick, I get the press event only when
the button is released, as shown by xev, for instance:

ButtonPress event, serial 33, synthetic NO, window 0x6200001,
    root 0x2ec, subw 0x0, time 484856111, (73,106), root:(3030,1381),
    state 0x0, button 2, same_screen YES

ButtonRelease event, serial 33, synthetic NO, window 0x6200001,
    root 0x2ec, subw 0x0, time 484856111, (73,106), root:(3030,1381),
    state 0x200, button 2, same_screen YES

You can see that I got both events at the same time. A consequence
is that under fvwm, popups bound to the middle button do not work
at all when I use the middle button associated with the pointstick.

Some details...

With the input-events utility, I get:

* For the pointstick (associated with /dev/input/event2):

# input-events 2
/dev/input/event2
   bustype : BUS_I8042
   vendor  : 0x2
   product : 0x1
   version : 0
   name    : "PS/2 Generic Mouse"
   phys    : "isa0060/serio2/input0"
   bits ev : (null) (null) (null)

* For the touchpad (associated with /dev/input/event3):

# input-events 3
/dev/input/event3
   bustype : BUS_I8042
   vendor  : 0x2
   product : 0x7
   version : 433
   name    : "SynPS/2 Synaptics TouchPad"
   phys    : "isa0060/serio3/input0"
   bits ev : (null) (null) (null)

In both cases, when I test the 3 buttons, the "pressed" and "released"
events are reported exactly at the time I press or release the button.
In particular, with the middle button of the pointstick:

03:39:35.613850: (null) ??? (0x112) pressed
03:39:35.613850: (null) code=0 value=0
03:39:36.941501: (null) ??? (0x112) released
03:39:36.941501: (null) code=0 value=0

So, no problems at this level. I get the issue only under X.

Note that these input devices do not use the same driver, so that
I suppose that the issue comes from the driver. /var/log/Xorg.0.log
contains in particular:

[...]
[    21.243] (II) config/udev: Adding input device PS/2 Generic Mouse (/dev/input/event2)
[    21.243] (**) PS/2 Generic Mouse: Applying InputClass "evdev pointer catchall"
[    21.243] (**) PS/2 Generic Mouse: Applying InputClass "libinput pointer catchall"
[    21.243] (II) Using input driver 'libinput' for 'PS/2 Generic Mouse'
[    21.243] (**) PS/2 Generic Mouse: always reports core events
[    21.243] (**) Option "Device" "/dev/input/event2"
[    21.243] (**) Option "_source" "server/udev"
[    21.244] (II) event2  - PS/2 Generic Mouse: is tagged by udev as: Mouse
[    21.244] (II) event2  - PS/2 Generic Mouse: device is a pointer
[    21.245] (II) event2  - PS/2 Generic Mouse: device removed
[    21.316] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio2/input/input7/event2"
[    21.316] (II) XINPUT: Adding extended input device "PS/2 Generic Mouse" (type: MOUSE, id 11)
[    21.316] (**) Option "AccelerationScheme" "none"
[    21.316] (**) PS/2 Generic Mouse: (accel) selected scheme none/0
[    21.316] (**) PS/2 Generic Mouse: (accel) acceleration factor: 2.000
[    21.316] (**) PS/2 Generic Mouse: (accel) acceleration threshold: 4
[    21.317] (II) event2  - PS/2 Generic Mouse: is tagged by udev as: Mouse
[    21.317] (II) event2  - PS/2 Generic Mouse: device is a pointer
[    21.318] (II) config/udev: Adding input device PS/2 Generic Mouse (/dev/input/mouse0)
[    21.318] (II) No input driver specified, ignoring this device.
[    21.318] (II) This device may have been added with another device file.
[    21.318] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event3)
[    21.318] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"
[    21.318] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "libinput touchpad catchall"
[    21.318] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"
[    21.318] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "Default clickpad buttons"
[    21.318] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad"
[    21.318] (II) LoadModule: "synaptics"
[    21.319] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
[    21.320] (II) Module synaptics: vendor="X.Org Foundation"
[    21.320]    compiled for 1.20.8, module version = 1.9.1
[    21.320]    Module class: X.Org XInput Driver
[    21.320]    ABI class: X.Org XInput driver, version 24.1
[    21.320] (II) Using input driver 'synaptics' for 'SynPS/2 Synaptics TouchPad'
[    21.320] (**) SynPS/2 Synaptics TouchPad: always reports core events
[    21.320] (**) Option "Device" "/dev/input/event3"
[    21.388] (--) synaptics: SynPS/2 Synaptics TouchPad: x-axis range 1324 - 5660 (res 42)
[    21.388] (--) synaptics: SynPS/2 Synaptics TouchPad: y-axis range 1248 - 4730 (res 63)
[    21.388] (--) synaptics: SynPS/2 Synaptics TouchPad: pressure range 0 - 255
[    21.388] (--) synaptics: SynPS/2 Synaptics TouchPad: finger width range 0 - 15
[    21.388] (--) synaptics: SynPS/2 Synaptics TouchPad: buttons: left right middle double triple
[    21.388] (--) synaptics: SynPS/2 Synaptics TouchPad: Vendor 0x2 Product 0x7
[    21.388] (**) Option "VertEdgeScroll" "on"
[    21.388] (**) Option "HorizEdgeScroll" "on"
[    21.388] (**) Option "VertTwoFingerScroll" "on"
[    21.388] (**) Option "HorizTwoFingerScroll" "on"
[    21.388] (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found
[    21.388] (**) SynPS/2 Synaptics TouchPad: always reports core events
[    21.460] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio3/input/input8/event3"
[    21.460] (II) XINPUT: Adding extended input device "SynPS/2 Synaptics TouchPad" (type: TOUCHPAD, id 12)
[    21.460] (**) synaptics: SynPS/2 Synaptics TouchPad: (accel) MinSpeed is now constant deceleration 2.5
[    21.460] (**) synaptics: SynPS/2 Synaptics TouchPad: (accel) MaxSpeed is now 1.75
[    21.460] (**) synaptics: SynPS/2 Synaptics TouchPad: (accel) AccelFactor is now 0.036
[    21.460] (**) SynPS/2 Synaptics TouchPad: (accel) keeping acceleration scheme 1
[    21.460] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration profile 1
[    21.460] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration factor: 2.000
[    21.460] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration threshold: 4
[    21.460] (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found
[    21.460] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/mouse1)
[    21.461] (**) SynPS/2 Synaptics TouchPad: Ignoring device from InputClass "touchpad ignore duplicates"
[...]