1

That heisenbug in touchpad KCM is fixed

KDE touchpad configuration module supports both Libinput touchpad driver and Synaptics driver. Newer versions of distros like Fedora 22 comes with both libinput and synaptics drivers installed, where libinput driver is chosen by default for touchpads. Some users wanted to use synaptics driver and tweak all options exported by it using the touchpad KDE control module. To do so, simply uninstall the libinput driver (xorg-x11-drv-libinput) and touchpad kcm uses synaptics driver which makes all the kcm options tweak-able. Some of those users reported that after uninstalling libinput driver but keeping synaptics driver (xorg-x11-drv-synaptics), touchpad KCM displayed the error message “No touchpad found” and no options were editable as reported in this bug.

This wasn’t easily reproducible in my system though I have seen it once or twice. On a fresh Fedora 22 KDE spin installation which comes with both libinput and synaptics drivers, I was able to reproduce the issue by simply uninstalling libinput driver which helped to debug the issue. The XlibBackend class first checked for the presence of X atom “libinput Tapping Enabled” to determine if libinput driver is active. In that case, the XlibLibinputBackend was instantiated which handled the configuration. Otherwise, fallback to synaptics driver and instantiate XlibSynapticsBackend.

The issue, turns out that X atom “libinput Tapping Enabled” is active even after libinput driver is uninstalled! This was verified by checking the list of initialized atoms, with a nimble tool “xlsatoms” from the xorg-x11-utils package. With and without libinput driver installed, the output of this command were something like:

$ xlsatoms | grep -i tap
316 libinput Tapping Enabled
$ dnf remove xorg-x11-drv-libinput
(logout/restart and login again for X to use synaptics driver)
$ xlsatoms | grep -i tap
313 libinput Tapping Enabled
342 synaptics Tap Action

Which clearly shows the libinput atom is active even when driver is not installed. That caused the KCM code to try to instantiate XlibLibinputBackend which is non-existent and fails with error message “No touchpad found”. This seems to be a bug in Clutter, Mutter and Gtk+ as found out in this Fedora bug ‘touchpad not found’ . Those toolkits inadvertently created this atom while the intention was to check its existence; but I don’t know if kcm_touchpad code was also creating this atom.

With that finding, kcm_touchpad code is revised to first instantiate XlibLibinputBackend and checks for failures. If it fails, we try to instantiate the XlibSynapticsBackend. It is a small fix, yet solves an issue that affected many users. This fix is confirmed by some testers and is now pushed to plasma-desktop. The code adds a couple of error messages, so it is not available in 5.3.2 release but will be available in 5.4.0.

11

Libinput support added to Touchpad KCM

libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input driver. It provides device detection, device handling, input device event processing and abstraction so minimize the amount of custom input code compositors need to provide the common set of functionality that users expect.

libinput is expected to replace input drivers such as synpatics in the future, and there’s already a drive to move input stack in Fedora 22 to libinput as can be seen in the discussion here. Most of the software would transparently work, except – as quickly noted in that discussion – the KDE touchpad configuration. Tochpad KCM exposes almost every knob present in the synaptics driver. In contrast, libinput exposes very few options to configure – such as tap-to-click and keeps most of the other options enabled by default – such as disable touchpad while typing. This is more sensible and efficient to do – when using synaptics driver, disabling touchpad while typing was accomplished by the synclient daemon.

As an aftermath of the discussion in Fedora, libinput maintainer Peter Hutter contacted KDE developers, including yours truly who is guilty of porting the kcm-touchpad to KDE Frameworks 5. As I know nothing about input stack or touchpads in general (phew), Peter was kind enough to step up, clone the kcm-touchpad and add support for libinput in addition to (existing) synaptics driver. All I had to do then, is to port it again to Frameworks 5.

Tochpad KCM running on libinput

Tochpad KCM running on libinput

As of last week, the review request to do that has been reviewed by Martin Gräßlin and David Edmundson and merged into the master branch – in the meantime I have obtained KDE developer commit access. In other words, Touchpad KCM now supports both libinput and synaptics drivers! If both are installed, libinput is preferred and exposes only the relevant options. As the KCM user interface exposes a lot of options, most of them remain disabled. Ideally, it should be re-designed – for example the GNOME mouse/touchpad configuration (including GNOME Tweak tool) exposes very few options. Alexander Mezin, kcm-touchpad maintainer has mentioned plan to rewrite it, I hope he will be able to find some time.

The updated kcm-tochpad packages for Fedora 20, 21 and Rawhide (what to become F22) are available for testing in the copr in Fedora repositories. For some caveats such as edge scrolling available only on single-touch touchpads, see the discussion and associated bug here. There’s still some issue with edge scrolling setting, I’m investigating it.

1

KDE Frameworks 5 based apps available in copr

I have built RPM packages of some KDE applications frameworks branch, such as Konsole, Dolphin which are available in my copr. It is based on the Plasma-5.2 beta copr from Dan Vratil, you’d need to enable it first to pull dependencies. Packages are available for Fedora 20 and 21, i386 and x86_64 architectures.

Dolphin-Plasma-5.2-beta