Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1421439 - Logitech Marble Mouse: No middle paste emulation in Wayland (works in X)
Summary: Logitech Marble Mouse: No middle paste emulation in Wayland (works in X)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libinput
Version: 25
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Hutterer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-12 11:00 UTC by eagleton
Modified: 2017-03-09 13:23 UTC (History)
5 users (show)

Fixed In Version: libinput-1.6.2-3.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-09 13:23:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 99845 0 None None None 2017-02-17 01:07:25 UTC

Description eagleton 2017-02-12 11:00:53 UTC
Description of problem:
The Logitech Marble Mouse has no scrollwheel. Using X, it is possible to get middle click emulation, but there is no obvious way to get this with Wayland.

Additional info:
http://forums.fedoraforum.org/showthread.php?t=312288

Comment 1 mjvaisane 2017-02-13 04:30:41 UTC
I have tested this by trying to change dconf setting /org/gnomedesktop/peripherals/trackball/scroll-wheel-emulation-button to different value (I have tried all possible numbers from 3 to 9). But that setting does not seem to have any effect

Comment 2 Peter Hutterer 2017-02-13 22:45:19 UTC
I'll need the pid/vid for this device, simplest way: attach the output from sudo evemu-describe please.

also the udevadm info output, because I'm pretty sure this one doesn't get tagged as a trackball with that name.

we'll need a hwdb entry for this device and then add code to libinput to enable middle button emulation by default. That's what we already do on devices without middle buttons anyway, I suspect in this case the device just says it has one when it really doesn't.

scroll-wheel-emulation-button: that setting is for button-based scrolling and has no effect on middle button behaviour.

Comment 3 mjvaisane 2017-02-14 05:49:32 UTC
evemu-describe

Available devices:
/dev/input/event0:	Lid Switch
/dev/input/event1:	Sleep Button
/dev/input/event2:	Power Button
/dev/input/event3:	AT Translated Set 2 keyboard
/dev/input/event4:	SynPS/2 Synaptics TouchPad
/dev/input/event5:	TPPS/2 IBM TrackPoint
/dev/input/event6:	Video Bus
/dev/input/event8:	Lenovo ThinkPad Compact USB Keyboard with TrackPoint
/dev/input/event9:	Lenovo ThinkPad Compact USB Keyboard with TrackPoint
/dev/input/event10:	Logitech USB Trackball
/dev/input/event11:	C-Media Electronics Inc. ThinkPad OneLink Pro Dock Audio
/dev/input/event12:	ThinkPad Extra Buttons
/dev/input/event13:	HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event14:	HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event15:	HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event16:	HDA Intel PCH Mic
/dev/input/event17:	HDA Intel PCH Headphone
/dev/input/event18:	Integrated Camera


udevadm info /dev/input/event10

P: /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1/1-3.1.2/1-3.1.2:1.0/0003:046D:C408.0014/input/input34/event10
N: input/event10
S: input/by-id/usb-Logitech_USB_Trackball-event-mouse
S: input/by-path/pci-0000:00:14.0-usb-0:3.1.2:1.0-event-mouse
E: DEVLINKS=/dev/input/by-path/pci-0000:00:14.0-usb-0:3.1.2:1.0-event-mouse /dev/input/by-id/usb-Logitech_USB_Trackball-event-mouse
E: DEVNAME=/dev/input/event10
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1/1-3.1.2/1-3.1.2:1.0/0003:046D:C408.0014/input/input34/event10
E: ID_BUS=usb
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_MODEL=USB_Trackball
E: ID_MODEL_ENC=USB\x20Trackball
E: ID_MODEL_ID=c408
E: ID_PATH=pci-0000:00:14.0-usb-0:3.1.2:1.0
E: ID_PATH_TAG=pci-0000_00_14_0-usb-0_3_1_2_1_0
E: ID_REVISION=1400
E: ID_SERIAL=Logitech_USB_Trackball
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030102:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=Logitech
E: ID_VENDOR_ENC=Logitech
E: ID_VENDOR_ID=046d
E: LIBINPUT_DEVICE_GROUP=3/46d/c408/110:usb-0000:00:14.0-3.1
E: LIBINPUT_MODEL_TRACKBALL=1
E: MAJOR=13
E: MINOR=74
E: SUBSYSTEM=input
E: USEC_INITIALIZED=30144457462

Comment 4 Peter Hutterer 2017-02-14 22:14:21 UTC
you forgot to select the event node in evemu-describe, that's just the list of devices :)

Comment 5 mjvaisane 2017-02-15 05:54:56 UTC
Oh sorry :)

# EVEMU 1.3
# Kernel: 4.9.8-201.fc25.x86_64
# DMI: dmi:bvnLENOVO:bvrN14ET38W(1.16):bd12/07/2016:svnLENOVO:pn20BS003LMS:pvrThinkPadX1Carbon3rd:rvnLENOVO:rn20BS003LMS:rvrSDK0E50510WIN:cvnLENOVO:ct10:cvrNone:
# Input device name: "Logitech USB Trackball"
# Input device ID: bus 0x03 vendor 0x46d product 0xc408 version 0x110
# Supported events:
#   Event type 0 (EV_SYN)
#     Event code 0 (SYN_REPORT)
#     Event code 1 (SYN_CONFIG)
#     Event code 2 (SYN_MT_REPORT)
#     Event code 3 (SYN_DROPPED)
#     Event code 4 ((null))
#     Event code 5 ((null))
#     Event code 6 ((null))
#     Event code 7 ((null))
#     Event code 8 ((null))
#     Event code 9 ((null))
#     Event code 10 ((null))
#     Event code 11 ((null))
#     Event code 12 ((null))
#     Event code 13 ((null))
#     Event code 14 ((null))
#   Event type 1 (EV_KEY)
#     Event code 272 (BTN_LEFT)
#     Event code 273 (BTN_RIGHT)
#     Event code 274 (BTN_MIDDLE)
#     Event code 275 (BTN_SIDE)
#     Event code 276 (BTN_EXTRA)
#   Event type 2 (EV_REL)
#     Event code 0 (REL_X)
#     Event code 1 (REL_Y)
#   Event type 4 (EV_MSC)
#     Event code 4 (MSC_SCAN)
# Properties:
N: Logitech USB Trackball
I: 0003 046d c408 0110
P: 00 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 1f 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 02 03 00 00 00 00 00 00 00
B: 03 00 00 00 00 00 00 00 00
B: 04 10 00 00 00 00 00 00 00
B: 05 00 00 00 00 00 00 00 00
B: 11 00 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00

Comment 6 Fedora Update System 2017-02-21 23:22:44 UTC
libinput-1.6.2-2.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-67d4fc728f

Comment 7 mjvaisane 2017-02-22 06:56:14 UTC
After installing this update manually, middle click emulation seems to work by using both 1 and 3 mouse buttons simultaneously.

Comment 8 Peter Hutterer 2017-02-22 07:01:39 UTC
thanks!

Comment 9 eagleton 2017-02-22 09:44:48 UTC
Awesome, it's working! It's even better than under X, where you needed a config file. I submitted a Karma point for this.

Comment 10 Fedora Update System 2017-02-22 21:08:55 UTC
libinput-1.6.2-2.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-67d4fc728f

Comment 11 Jens Lody 2017-02-24 00:01:39 UTC
I just gave negative karma, because middle-mouse-button-emulation does not work for me under wayland and additionaly the scroll-wheel-emulation under x is broken.
Downgrading to 1.6.0-2 makes scroll-wheel-emulation under x work again.
Note: to make it work under x I use the following script:

#!/bin/sh
xinput set-button-map "Logitech USB Trackball" 1 8 3 4 5 6 7 2 9
xinput set-prop "Logitech USB Trackball" "libinput Button Scrolling Button" 8

The script has to be run in a running x-session once after the trackball (mouse) is plugged in.

Comment 12 Peter Hutterer 2017-02-24 04:53:10 UTC
What's the output of libinput-list-devices. And what is the output of libinput-debug-events --verbose when you press the l+r button on the trackball?
That should narrow down where the bug is.

Run it with libinput-debug-events --set-scroll-method=button --set-scroll-button=BTN_SIDE --verbose and check if the button scrolling works (I think BTN_SIDE is what the device has, pls verify with evemu-record)

(In reply to Jens Lody from comment #11)
> xinput set-button-map "Logitech USB Trackball" 1 8 3 4 5 6 7 2 9

this maps the middle button to button 8 and physical button 4 to middle. So with middle button emulation enabled, that would now generate "back" while button 4 would generate a middle click. This is what you intended?

Comment 13 Jens Lody 2017-02-24 08:03:47 UTC
The button mapping worked for my normal usecase (I never use the back-button of the mouse), but any way I slightly changed it now to be:
xinput set-button-map "Logitech USB Trackball" 1 9 3 4 5 6 7 2 8

This makes left and right-button behave normally, BTN_SIDE (the little left-button) is the middle-button, if clicked and used to emulate the mouse-wheel together with the ball if hold. The little right-button (BTN_EXTRA) is now the back-button.
All this only works with 1.6.0 and the mapping-script.

I put a tar-ball with all possible variants of libinput-list-devices and libinput-debug-events on my site: https://rpm.jenslody.de/libinput/libinput.tar.xz

The device-list is always the same for all variants with 1.6.0 and and all variants 1.6.2 (as expected), but differs between the versions.
For the debug-events, I always pressed all buttons from left to right once, the moved the cursor, clicked left, moved the cursor again, then pressed BTN_SIDE and moved the ball again (should be wheel emulation).

Comment 14 Peter Hutterer 2017-02-27 01:00:02 UTC
fwiw, libinput-* commands aren't affected by anything in X/Wayland, they run in their separate libinput context and always provide the same results. Think of it more like running cat on a read-only file, it doesn't matter which text editor you have it open in already. 

ok, log file analysis of the libinput-list-devices:
* 1.6.0 has middle button emulation config disabled but available, 1.6.2 has the config non-available. That is intended, libinput 1.6.2 doesn't expose the config option anymore, MB emulation is always on.
* 1.6.0 has scroll method button enabled by default, 1.6.2 has it disabled by default. That is intended, previously the device announced a middle button (it didn't have) and enabled button-scroll on middle button.

that's for the wayland logs, what is strange is that some xorg logs have different values - and that cannot be, see first paragraph. I wonder if you ran the commands in the wrong order between downgrading? The 1.6.2 'mapped' xorg output shows the 1.6.0 output.

Anyway, the wayland/1.6.2/no-mapping/libinput_debug_events file shows that it's working, based on your description. middle button emulation is present but since you're not triggering it by pressing l+r simultaneously it just passes through. button scrolling works and generates axis events.

Since the device does not have announce a physical middle button after the 1.6.2 patch set, libinput defaults to button 0 as scroll wheel emulation button (i.e. it needs to be configured and enabled). That's probably the wayland issue now, you would need to set org.gnome.desktop.peripherals.trackball scroll-wheel-emulation-button for button scrolling to work.  The same applies to X (and that is what your script does). 

Given that we already have model-specific quirks for this device this seems like something we might as well ship by default.

but now I'm wondering if we talk about the same thing... "middle button emulation" has a very specific meaning [1] and based on the above I'm wondering if you talk about button mapping instead?

[1] https://wayland.freedesktop.org/libinput/doc/latest/middle_button_emulation.html

Comment 15 Jens Lody 2017-02-27 14:02:43 UTC
I just reverted my negative karma, because the driver works as described.
To think that the middle-mouse-button-emulation is not working, was my mistake, sorry for the noise.

I'm used to map middle-mous-button to the left extra-button, but this does not work under wayland.
And the scrollwheel-emulation does not work under x and wayland.
I can change the value of "org.gnome.desktop.peripherals.trackball scroll-wheel-emulation-button" to any of the allowed values, but scroll-wheel-emulation does not work.

By the way is there a way to map buttons under wayland as it was possible with xinput ?

Comment 16 Peter Hutterer 2017-02-27 22:06:04 UTC
(In reply to Jens Lody from comment #15)
> I just reverted my negative karma, because the driver works as described.
> To think that the middle-mouse-button-emulation is not working, was my
> mistake, sorry for the noise.

thanks!

> I'm used to map middle-mous-button to the left extra-button, but this does
> not work under wayland.

button mapping beyond the physical button set is out of scope for libinput, that is part of the compositor's functionality. so this is something that mutter would have to provide.

> And the scrollwheel-emulation does not work under x and wayland.
> I can change the value of "org.gnome.desktop.peripherals.trackball
> scroll-wheel-emulation-button" to any of the allowed values, but
> scroll-wheel-emulation does not work.

does it work with the xinput commands though? specifically, you need to enable it and set the scroll button correctly because the current defaults in libinput have it effectively disabled. Specifically:
xinput set-prop "device name" "libinput Scroll Method Enabled" 0 0 1
xinput set-prop "device name" "libinput Button Scrolling Button" 8

to have button 8 as scroll button. If it works setting these things manually, then the issue is in the gnome stack and we can continue there.
 
> By the way is there a way to map buttons under wayland as it was possible
> with xinput ?

see above, that's a compositor-specific functionality, so if anything it'd be in gsettings somewhere. That does not however exist just yet.

Comment 17 Jens Lody 2017-02-27 22:47:52 UTC
(In reply to Peter Hutterer from comment #16)
> (In reply to Jens Lody from comment #15)
> > I just reverted my negative karma, because the driver works as described.
> > To think that the middle-mouse-button-emulation is not working, was my
> > mistake, sorry for the noise.
> 
> thanks!
> 
> > I'm used to map middle-mous-button to the left extra-button, but this does
> > not work under wayland.
> 
> button mapping beyond the physical button set is out of scope for libinput,
> that is part of the compositor's functionality. so this is something that
> mutter would have to provide.
> 
> > And the scrollwheel-emulation does not work under x and wayland.
> > I can change the value of "org.gnome.desktop.peripherals.trackball
> > scroll-wheel-emulation-button" to any of the allowed values, but
> > scroll-wheel-emulation does not work.
> 
> does it work with the xinput commands though? specifically, you need to
> enable it and set the scroll button correctly because the current defaults
> in libinput have it effectively disabled. Specifically:
> xinput set-prop "device name" "libinput Scroll Method Enabled" 0 0 1
> xinput set-prop "device name" "libinput Button Scrolling Button" 8
> 
> to have button 8 as scroll button. If it works setting these things
> manually, then the issue is in the gnome stack and we can continue there.
>  
Yes it works fine with xinput and "Scroll Method Enabled" in X.
Many thanks !

It does not work in wayland, because xinput does not see the trackball, but I guess that is expected with xinput under wayland.

> > By the way is there a way to map buttons under wayland as it was possible
> > with xinput ?
> 
> see above, that's a compositor-specific functionality, so if anything it'd
> be in gsettings somewhere. That does not however exist just yet.

Comment 19 Fedora Update System 2017-03-07 00:18:30 UTC
libinput-1.6.2-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-89f8404bd9

Comment 20 Fedora Update System 2017-03-07 14:22:31 UTC
libinput-1.6.2-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-89f8404bd9

Comment 21 Fedora Update System 2017-03-09 13:23:02 UTC
libinput-1.6.2-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.