-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add libinput support for mouse and touchpad #166
Conversation
Most of the laptop settings I cannot easily test, as I develop on a desktop and it is a considerable production to move everything over to it and update. That is done at intervals but not while I am using the desktop. Of the laptop settings, for me it is really crucial that disable while typing either not default to on or be easily disabled. If I have to set custom values somwhere that can't later be reset in mate-settings-daemon I could easily forget ever having done so and thus miss a failure of such a setting in m-s-d to work. The disable while typing situation has at times in the past caused me enough trouble when using the laptop to force me to disable syndaemon so as to disable it when normal settings did not work. |
Can we revert version requirement in this branch for testing? |
Btw. mouse settings seems to be working with m-c-c or dconf-editor, except 'show pointer'. |
Ok, i think touchpad and most settings for it are working. |
I can confirm mouse settings working on Debian Unstable except of course "show pointer." Wonder if libinput simply does not support that? I'll test the touchpad settings as soon as I can get this and my other updates over to the laptop |
OK, I can now confirm that touchpad settings also work, though I am by no means certain whether libinput or Synaptics is taking priority on that. i was able to verify that the crucial setting to enable or disable "disable touchpad while typing" is working. |
The touchpad settings work even when org.gnome.desktop.peripherals.touchpad send-events is set to "disabled" in gsettings, reverting the fix that used to be necessary to get the touchpad to show up at all in m-c-c. |
If you want to test the touchpad code without a touchpad, grab https://github.com/whot/evemu-devices and init any touchpad with sudo evemu-device. That will make a virtual touchpad appear, you can then check whether the right properties are toggled with xinput watch-props "..device name..." As for the original questions:
show pointer: that's something entirely handled by the client, libinput doesn't have a say here. libinput doesn't know where the pointer is anyway. I think that's all questions answered, sorry, don't have time to review the patches themselves right now. but thanks heaps for implementing this! |
If the separate threshold and acceleration no longer exist with libinput, then they could be combined in the GUI at whatever point all distros are using libinput. Ideally it would detect whether libinput or synaptics was handling the touchpad and show only the relevant options, but that's not something I would be able to code up at this point. |
About "show pointer": it seems to be broken with GTK+3, I've noticed it a while ago. I remember it was working in GTK+2 build, I've tested it once. How to check whether libinput is handling your device: use |
@whot: many thanks for the hint about emulation, this is what I've been searching for! I've used "ETPS/2 Elantech Touchpad" for testing. So far, most options work fine. However, |
@whot: thanks for the answers. Looks like no additional code changes are needed here - unless I missed something. I only have an additional question about that new libinput function (for tapping): would these LRM/LMR mappings be exposed via X properties somehow? |
libinput touchpads are recognized by checking if they have tapping property - same as done here: linuxmint/cinnamon-settings-daemon@7e48221
note: libinput function doesn't use additional arguments since no button remapping is needed for it adapted from: linuxmint/cinnamon-settings-daemon@8551023
note: libinput does not allow for both edge and twofinger scrolling to be enabled simultaneously. We prefer twofinger scrolling. The same goes for horizontal scrolling, it picks the setting for whatever scroll method we applied. adapted from: linuxmint/cinnamon-settings-daemon@8244209
note: libinput does not allow for configuration of the click actions, the options are just "software buttons" or "clickfinger". If any clickfinger actions are set, we enable clickfinger, otherwise software buttons. adapted from: linuxmint/cinnamon-settings-daemon@6394ea6
note: libinput function doesn't have button remapping code, it's handled in libinput already adapted from: linuxmint/cinnamon-settings-daemon@c35f952
note: threshold setting is ignored as libinput doesn't have it adapted from: linuxmint/cinnamon-settings-daemon@1e7d504
time for a new release.... |
That's for sure... |
@monsta: yep, the tapping button map is exposed as "libinput Tapping Button Mapping Enabled", see https://cgit.freedesktop.org/xorg/driver/xf86-input-libinput/tree/include/libinput-properties.h#n47 |
Oh indeed, I see it in my Debian Testing VM (with libinput driver 0.23.0). |
Found out why I couldn't change |
@whot |
@raveit65 we had some recent fixes in libinput for that, see https://who-t.blogspot.com.au/2016/12/libinput-touchpad-pointer-acceleration.html. That's only on master so far, not in a released version yet. |
@whot: hmm, looks like I can't get the horizontal scroll property to change because there's "Horizonal" instead of "Horizontal" in the property name... |
@monsta: that was fixed in xf86-input-libinput-0.20.0, but that one is only in f25, not f24 |
@whot |
yeah, at least by default. don't think I'll switch it to libinput, too many changes. |
I'm using Mint 18.1 (based on Ubuntu 16.04), and xorg-input-libinput is 0.18.0 here. I presume I need this commit to patch it? |
yep, that's the one |
Ok, it works. I'd like to send the patch to Ubuntu maintainers, but not sure which package(s) might use the |
google suggests apt-cache rdepends should tell you what requires the driver. Easiest would be to just rebuild all of them. |
Yeah, I know that tool, and it shows nothing here... but I remember it didn't always give me all the reverse deps in the past, so I'm not surprised. I think I'll just ask Ubuntu guys about the packages. |
This is backported from linuxmint/cinnamon-settings-daemon#131 (big thanks to @whot for this).
@clefebvre @flexiondotorg @raveit65 @XRevan86 @sc0w @lukefromdc
Please test it guys if you can. You'll need libinput driver for Xorg installed and taking priority over evdev and Synaptics. You can use
xinput
tool to check device properties and their values. For example, here's how my old mouse is shown:Since m-c-c doesn't have libinput support yet (for example, it only checks for Synaptics presence to determine whether to show touchpad settings tab), you'll probably have to use other tools for changing GSettings keys in
org.mate.peripherals-mouse
andorg.mate.peripherals-touchpad
schemas.Here are some details about differences between old code (for evdev and Synaptics) and libinput support code. Sorry @whot... I have some additional questions for you below, please forgive my ignorance 😄
tap to click (4e098ea): when setting this property, libinput part of code doesn't take left-handed and 1/2/3 finger tap properties into account. While left-handed property isn't needed here (libinput manages it on its own), I'm not sure about finger tap ones. It wasn't an issue in Cinnamon since it seems to be MATE-only option (added in Settings for touchpad taps #86). Should we do anything about 1/2/3 finger tap properties in libinput parts of code?
edge and two-finger scrolling (c75315d): libinput only allows either one to be enabled at the same time. Following the Cinnamon code, I've made two-finger one preferable. However, each property is set in its own boolean value in libinput (in
libinput Scroll Method Enabled
property), so could it be theoretically possible for libinput to support both at the same time in some future release?click actions (43bc83e): libinput doesn't support setting two or three finger click, there's only a single "clickfinger" setting (or no finger click if "buttonareas" is set instead). Since it's a single boolean value (in
libinput Click Method Enabled
property), I guess we have no way to tell libinput whether we prefer two or three finger click. So the question is, which of them will actually work when "clickfinger" is enabled in libinput?left-handed (2bc9262): libinput part of code doesn't use button remapping as libinput handles that by itself. But does libinput check if a device has a single button (or any buttons at all)? In the old code, there are checks for that before making any changes.
acceleration (f2b0f0c): libinput doesn't have a setting for a threshold. That setting is called "sensitivity" in mouse and touchpad properties UI, but it really is a "distance in pixels the pointer must move before accelerated mouse/touchpad motion is activated". So does libinput use some internal value for it?