commit:     a4a1a612115a4696cfd09bce70f06d637c16ae1e
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  4 11:36:24 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Oct  4 12:22:55 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4a1a612

kde-plasma/plasma-desktop: Make mouse KCM not interfere w/ touchpads

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
Package-Manager: Portage-2.3.50, Repoman-2.3.11

 ...ktop-5.13.5-libinput-kcm-ignore-touchpads.patch | 139 +++++++++++++++++
 .../plasma-desktop/plasma-desktop-5.13.5-r2.ebuild | 169 +++++++++++++++++++++
 2 files changed, 308 insertions(+)

diff --git 
a/kde-plasma/plasma-desktop/files/plasma-desktop-5.13.5-libinput-kcm-ignore-touchpads.patch
 
b/kde-plasma/plasma-desktop/files/plasma-desktop-5.13.5-libinput-kcm-ignore-touchpads.patch
new file mode 100644
index 00000000000..76b3e1b0f3e
--- /dev/null
+++ 
b/kde-plasma/plasma-desktop/files/plasma-desktop-5.13.5-libinput-kcm-ignore-touchpads.patch
@@ -0,0 +1,139 @@
+From a4c724173b5c6a59331587f2e5db746dffbabdc6 Mon Sep 17 00:00:00 2001
+From: Roman Gilg <subd...@gmail.com>
+Date: Tue, 4 Sep 2018 00:15:18 +0200
+Subject: [Mouse KCM] Avoid changes to touchpads in libinput backend
+
+Summary:
+Similar to evdev backend we need to ignore touchpad devices explicitly in the
+libinput backend because these are also pointer devices.
+
+XInput2 can do this in theory via input classes, but my touchpad did not set
+the class correctly. So just switch to using XInput like in the evdev backend
+to query all pointer devices and then use the XI_TOUCHPAD atom to filter out
+touchpads.
+
+BUG: 395401
+BUG: 395722
+BUG: 396269
+
+Test Plan: Manually
+
+Reviewers: #plasma, hein
+
+Reviewed By: #plasma, hein
+
+Subscribers: acrouthamel, ngraham, plasma-devel
+
+Tags: #plasma
+
+Differential Revision: https://phabricator.kde.org/D15256
+---
+ .../backends/x11/x11_libinput_dummydevice.cpp      | 32 ++++++++++++++--------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp 
b/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp
+index 6efca42..7ec314b 100644
+--- a/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp
++++ b/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp
+@@ -20,24 +20,28 @@
+ 
+ #include <libinput-properties.h>
+ 
+-#include <X11/Xlib.h>
+ #include <X11/Xatom.h>
+ #include <X11/extensions/XInput2.h>
++#include <X11/extensions/XInput.h>
++
++static Atom s_touchpadAtom;
+ 
+ template<typename Callback>
+-static void XI2ForallPointerDevices(Display* dpy, const Callback& callback)
++static void XIForallPointerDevices(Display* dpy, const Callback& callback)
+ {
+     int ndevices_return;
+-    XIDeviceInfo* info = XIQueryDevice(dpy, XIAllDevices, &ndevices_return);
++    XDeviceInfo *info = XListInputDevices(dpy, &ndevices_return);
+     if (!info) {
+         return;
+     }
+     for (int i = 0; i < ndevices_return; ++i) {
+-        if ((info + i)->use == XISlavePointer) {
+-            callback(info + i);
++        XDeviceInfo *dev = info + i;
++        if ((dev->use == IsXPointer || dev->use == IsXExtensionPointer) &&
++                dev->type != s_touchpadAtom) {
++            callback(dev);
+         }
+     }
+-    XIFreeDeviceInfo(info);
++    XFreeDeviceList(info);
+ }
+ 
+ struct ScopedXDeleter {
+@@ -61,7 +65,8 @@ void valueWriterPart(T val, Atom valAtom, Display *dpy)
+ template<>
+ void valueWriterPart<bool>(bool val, Atom valAtom, Display *dpy)
+ {
+-    XI2ForallPointerDevices(dpy, [&] (XIDeviceInfo *info) {
++    XIForallPointerDevices(dpy, [&] (XDeviceInfo *info) {
++        int deviceid = info->id;
+         Status status;
+         Atom type_return;
+         int format_return;
+@@ -70,7 +75,7 @@ void valueWriterPart<bool>(bool val, Atom valAtom, Display 
*dpy)
+ 
+         unsigned char *_data = nullptr;
+         //data returned is an 1 byte boolean
+-        status = XIGetProperty(dpy, info->deviceid, valAtom, 0, 1,
++        status = XIGetProperty(dpy, deviceid, valAtom, 0, 1,
+                                False, XA_INTEGER, &type_return, 
&format_return,
+                                &num_items_return, &bytes_after_return, 
&_data);
+         if (status != Success) {
+@@ -87,7 +92,7 @@ void valueWriterPart<bool>(bool val, Atom valAtom, Display 
*dpy)
+ 
+         unsigned char sendVal = val ? 1 : 0;
+ 
+-        XIChangeProperty(dpy, info->deviceid, valAtom, XA_INTEGER,
++        XIChangeProperty(dpy, deviceid, valAtom, XA_INTEGER,
+                          8, XIPropModeReplace, &sendVal, 1);
+ 
+     });
+@@ -96,7 +101,8 @@ void valueWriterPart<bool>(bool val, Atom valAtom, Display 
*dpy)
+ template<>
+ void valueWriterPart<qreal>(qreal val, Atom valAtom, Display *dpy)
+ {
+-    XI2ForallPointerDevices(dpy, [&] (XIDeviceInfo *info) {
++    XIForallPointerDevices(dpy, [&] (XDeviceInfo *info) {
++        int deviceid = info->id;
+         Status status;
+         Atom float_type = XInternAtom (dpy, "FLOAT", False);
+         Atom type_return;
+@@ -106,7 +112,7 @@ void valueWriterPart<qreal>(qreal val, Atom valAtom, 
Display *dpy)
+ 
+         unsigned char *_data = nullptr;
+         //data returned is an 1 byte boolean
+-        status = XIGetProperty(dpy, info->deviceid, valAtom, 0, 1,
++        status = XIGetProperty(dpy, deviceid, valAtom, 0, 1,
+                                False, float_type, &type_return, 
&format_return,
+                                &num_items_return, &bytes_after_return, 
&_data);
+         if (status != Success) {
+@@ -125,7 +131,7 @@ void valueWriterPart<qreal>(qreal val, Atom valAtom, 
Display *dpy)
+         float *sendPtr = (float*)buffer;
+         *sendPtr = val;
+ 
+-        XIChangeProperty(dpy, info->deviceid, valAtom, float_type,
++        XIChangeProperty(dpy, deviceid, valAtom, float_type,
+                          format_return, XIPropModeReplace, buffer, 1);
+ 
+     });
+@@ -161,6 +167,8 @@ X11LibinputDummyDevice::X11LibinputDummyDevice(QObject 
*parent, Display *dpy)
+ 
+     m_supportsNaturalScroll.val = true;
+     m_naturalScrollEnabledByDefault.val = false;
++
++    s_touchpadAtom = XInternAtom(m_dpy, XI_TOUCHPAD, True);
+ }
+ 
+ X11LibinputDummyDevice::~X11LibinputDummyDevice()
+-- 
+cgit v0.11.2

diff --git a/kde-plasma/plasma-desktop/plasma-desktop-5.13.5-r2.ebuild 
b/kde-plasma/plasma-desktop/plasma-desktop-5.13.5-r2.ebuild
new file mode 100644
index 00000000000..d771236bad5
--- /dev/null
+++ b/kde-plasma/plasma-desktop/plasma-desktop-5.13.5-r2.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KDE_HANDBOOK="forceoptional"
+KDE_TEST="true"
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="KDE Plasma desktop"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="appstream +fontconfig ibus +mouse pulseaudio scim +semantic-desktop 
touchpad"
+
+COMMON_DEPEND="
+       $(add_frameworks_dep attica)
+       $(add_frameworks_dep kactivities)
+       $(add_frameworks_dep kactivities-stats)
+       $(add_frameworks_dep karchive)
+       $(add_frameworks_dep kauth)
+       $(add_frameworks_dep kbookmarks)
+       $(add_frameworks_dep kcmutils)
+       $(add_frameworks_dep kcodecs)
+       $(add_frameworks_dep kcompletion)
+       $(add_frameworks_dep kconfig)
+       $(add_frameworks_dep kconfigwidgets)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep kdbusaddons)
+       $(add_frameworks_dep kdeclarative)
+       $(add_frameworks_dep kded)
+       $(add_frameworks_dep kdelibs4support)
+       $(add_frameworks_dep kemoticons)
+       $(add_frameworks_dep kglobalaccel)
+       $(add_frameworks_dep kguiaddons)
+       $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
+       $(add_frameworks_dep kio)
+       $(add_frameworks_dep kitemmodels)
+       $(add_frameworks_dep kitemviews)
+       $(add_frameworks_dep kjobwidgets)
+       $(add_frameworks_dep knewstuff)
+       $(add_frameworks_dep knotifications)
+       $(add_frameworks_dep knotifyconfig)
+       $(add_frameworks_dep kparts)
+       $(add_frameworks_dep kpeople)
+       $(add_frameworks_dep krunner)
+       $(add_frameworks_dep kservice)
+       $(add_frameworks_dep kwallet)
+       $(add_frameworks_dep kwidgetsaddons)
+       $(add_frameworks_dep kwindowsystem)
+       $(add_frameworks_dep kxmlgui)
+       $(add_frameworks_dep plasma)
+       $(add_frameworks_dep solid)
+       $(add_frameworks_dep sonnet)
+       $(add_plasma_dep kwin)
+       $(add_plasma_dep plasma-workspace)
+       $(add_qt_dep qtconcurrent)
+       $(add_qt_dep qtdbus)
+       $(add_qt_dep qtdeclarative)
+       $(add_qt_dep qtgui)
+       $(add_qt_dep qtnetwork)
+       $(add_qt_dep qtprintsupport)
+       $(add_qt_dep qtsql)
+       $(add_qt_dep qtsvg)
+       $(add_qt_dep qtwidgets)
+       $(add_qt_dep qtx11extras)
+       $(add_qt_dep qtxml)
+       media-libs/phonon[qt5(+)]
+       x11-libs/libX11
+       x11-libs/libXcursor
+       x11-libs/libXfixes
+       x11-libs/libXi
+       x11-libs/libxcb
+       x11-libs/libxkbfile
+       appstream? ( dev-libs/appstream[qt5] )
+       fontconfig? (
+               media-libs/fontconfig
+               media-libs/freetype
+               x11-libs/libXft
+               x11-libs/xcb-util-image
+       )
+       ibus? (
+               $(add_qt_dep qtx11extras)
+               app-i18n/ibus
+               dev-libs/glib:2
+               x11-libs/libxcb
+               x11-libs/xcb-util-keysyms
+       )
+       pulseaudio? (
+               dev-libs/glib:2
+               media-libs/libcanberra
+               media-sound/pulseaudio
+       )
+       scim? ( app-i18n/scim )
+       semantic-desktop? ( $(add_frameworks_dep baloo) )
+       touchpad? ( x11-drivers/xf86-input-synaptics )
+"
+DEPEND="${COMMON_DEPEND}
+       dev-libs/boost
+       x11-base/xorg-proto
+       fontconfig? ( x11-libs/libXrender )
+       mouse? (
+               x11-drivers/xf86-input-evdev
+               x11-drivers/xf86-input-libinput
+       )
+"
+RDEPEND="${COMMON_DEPEND}
+       $(add_frameworks_dep qqc2-desktop-style)
+       $(add_plasma_dep breeze)
+       $(add_plasma_dep kde-cli-tools)
+       $(add_plasma_dep oxygen)
+       $(add_qt_dep qtgraphicaleffects)
+       sys-apps/accountsservice
+       sys-apps/util-linux
+       x11-apps/setxkbmap
+       pulseaudio? ( $(add_plasma_dep plasma-pa ) )
+       !kde-apps/kcontrol
+       !<kde-apps/kde4-l10n-17.08.1-r1
+       !kde-apps/knetattach[handbook]
+       !kde-misc/kcm-touchpad
+       !kde-plasma/plasma-desktop:4
+       !kde-plasma/plasma-workspace:4
+       !kde-plasma/solid-actions-kcm:4
+       !kde-plasma/systemsettings:4
+"
+
+PATCHES=(
+       "${FILESDIR}/${P}-activityswitcher.patch"
+       "${FILESDIR}/${P}-kickersearch-nav.patch"
+       "${FILESDIR}/${P}-libinput-kcm-ignore-touchpads.patch"
+)
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake-utils_use_find_package appstream AppStreamQt)
+               $(cmake-utils_use_find_package fontconfig Fontconfig)
+               $(cmake-utils_use_find_package ibus IBus)
+               $(cmake-utils_use_find_package mouse Evdev)
+               $(cmake-utils_use_find_package mouse XorgLibinput)
+               $(cmake-utils_use_find_package pulseaudio PulseAudio)
+               $(cmake-utils_use_find_package scim SCIM)
+               $(cmake-utils_use_find_package semantic-desktop KF5Baloo)
+               $(cmake-utils_use_find_package touchpad Synaptics)
+       )
+
+       kde5_src_configure
+}
+
+src_test() {
+       # parallel tests fail, foldermodeltest hangs, bug #646890
+       # needs D-Bus, bug #634166
+       local myctestargs=(
+               -j1
+               -E "(foldermodeltest|test_kio_fonts)"
+       )
+
+       kde5_src_test
+}
+
+pkg_postinst() {
+       kde5_pkg_postinst
+
+       if has_version "x11-libs/gtk+:2" && ! has_version 
"dev-libs/libappindicator:2"; then
+               elog "For GTK+2 applications legacy-systray support, please 
install dev-libs/libappindicator:2."
+       fi
+       if has_version "x11-libs/gtk+:3" && ! has_version 
"dev-libs/libappindicator:3"; then
+               elog "For GTK+3 applications legacy-systray support, please 
install dev-libs/libappindicator:3."
+       fi
+}

Reply via email to