Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-plasma/plasma-desktop/files/, kde-plasma/plasma-desktop/
Date: Thu, 04 Oct 2018 12:23:34
Message-Id: 1538655775.a4a1a612115a4696cfd09bce70f06d637c16ae1e.asturm@gentoo
1 commit: a4a1a612115a4696cfd09bce70f06d637c16ae1e
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 4 11:36:24 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 4 12:22:55 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4a1a612
7
8 kde-plasma/plasma-desktop: Make mouse KCM not interfere w/ touchpads
9
10 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
11 Package-Manager: Portage-2.3.50, Repoman-2.3.11
12
13 ...ktop-5.13.5-libinput-kcm-ignore-touchpads.patch | 139 +++++++++++++++++
14 .../plasma-desktop/plasma-desktop-5.13.5-r2.ebuild | 169 +++++++++++++++++++++
15 2 files changed, 308 insertions(+)
16
17 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
18 new file mode 100644
19 index 00000000000..76b3e1b0f3e
20 --- /dev/null
21 +++ b/kde-plasma/plasma-desktop/files/plasma-desktop-5.13.5-libinput-kcm-ignore-touchpads.patch
22 @@ -0,0 +1,139 @@
23 +From a4c724173b5c6a59331587f2e5db746dffbabdc6 Mon Sep 17 00:00:00 2001
24 +From: Roman Gilg <subdiff@×××××.com>
25 +Date: Tue, 4 Sep 2018 00:15:18 +0200
26 +Subject: [Mouse KCM] Avoid changes to touchpads in libinput backend
27 +
28 +Summary:
29 +Similar to evdev backend we need to ignore touchpad devices explicitly in the
30 +libinput backend because these are also pointer devices.
31 +
32 +XInput2 can do this in theory via input classes, but my touchpad did not set
33 +the class correctly. So just switch to using XInput like in the evdev backend
34 +to query all pointer devices and then use the XI_TOUCHPAD atom to filter out
35 +touchpads.
36 +
37 +BUG: 395401
38 +BUG: 395722
39 +BUG: 396269
40 +
41 +Test Plan: Manually
42 +
43 +Reviewers: #plasma, hein
44 +
45 +Reviewed By: #plasma, hein
46 +
47 +Subscribers: acrouthamel, ngraham, plasma-devel
48 +
49 +Tags: #plasma
50 +
51 +Differential Revision: https://phabricator.kde.org/D15256
52 +---
53 + .../backends/x11/x11_libinput_dummydevice.cpp | 32 ++++++++++++++--------
54 + 1 file changed, 20 insertions(+), 12 deletions(-)
55 +
56 +diff --git a/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp b/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp
57 +index 6efca42..7ec314b 100644
58 +--- a/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp
59 ++++ b/kcms/mouse/backends/x11/x11_libinput_dummydevice.cpp
60 +@@ -20,24 +20,28 @@
61 +
62 + #include <libinput-properties.h>
63 +
64 +-#include <X11/Xlib.h>
65 + #include <X11/Xatom.h>
66 + #include <X11/extensions/XInput2.h>
67 ++#include <X11/extensions/XInput.h>
68 ++
69 ++static Atom s_touchpadAtom;
70 +
71 + template<typename Callback>
72 +-static void XI2ForallPointerDevices(Display* dpy, const Callback& callback)
73 ++static void XIForallPointerDevices(Display* dpy, const Callback& callback)
74 + {
75 + int ndevices_return;
76 +- XIDeviceInfo* info = XIQueryDevice(dpy, XIAllDevices, &ndevices_return);
77 ++ XDeviceInfo *info = XListInputDevices(dpy, &ndevices_return);
78 + if (!info) {
79 + return;
80 + }
81 + for (int i = 0; i < ndevices_return; ++i) {
82 +- if ((info + i)->use == XISlavePointer) {
83 +- callback(info + i);
84 ++ XDeviceInfo *dev = info + i;
85 ++ if ((dev->use == IsXPointer || dev->use == IsXExtensionPointer) &&
86 ++ dev->type != s_touchpadAtom) {
87 ++ callback(dev);
88 + }
89 + }
90 +- XIFreeDeviceInfo(info);
91 ++ XFreeDeviceList(info);
92 + }
93 +
94 + struct ScopedXDeleter {
95 +@@ -61,7 +65,8 @@ void valueWriterPart(T val, Atom valAtom, Display *dpy)
96 + template<>
97 + void valueWriterPart<bool>(bool val, Atom valAtom, Display *dpy)
98 + {
99 +- XI2ForallPointerDevices(dpy, [&] (XIDeviceInfo *info) {
100 ++ XIForallPointerDevices(dpy, [&] (XDeviceInfo *info) {
101 ++ int deviceid = info->id;
102 + Status status;
103 + Atom type_return;
104 + int format_return;
105 +@@ -70,7 +75,7 @@ void valueWriterPart<bool>(bool val, Atom valAtom, Display *dpy)
106 +
107 + unsigned char *_data = nullptr;
108 + //data returned is an 1 byte boolean
109 +- status = XIGetProperty(dpy, info->deviceid, valAtom, 0, 1,
110 ++ status = XIGetProperty(dpy, deviceid, valAtom, 0, 1,
111 + False, XA_INTEGER, &type_return, &format_return,
112 + &num_items_return, &bytes_after_return, &_data);
113 + if (status != Success) {
114 +@@ -87,7 +92,7 @@ void valueWriterPart<bool>(bool val, Atom valAtom, Display *dpy)
115 +
116 + unsigned char sendVal = val ? 1 : 0;
117 +
118 +- XIChangeProperty(dpy, info->deviceid, valAtom, XA_INTEGER,
119 ++ XIChangeProperty(dpy, deviceid, valAtom, XA_INTEGER,
120 + 8, XIPropModeReplace, &sendVal, 1);
121 +
122 + });
123 +@@ -96,7 +101,8 @@ void valueWriterPart<bool>(bool val, Atom valAtom, Display *dpy)
124 + template<>
125 + void valueWriterPart<qreal>(qreal val, Atom valAtom, Display *dpy)
126 + {
127 +- XI2ForallPointerDevices(dpy, [&] (XIDeviceInfo *info) {
128 ++ XIForallPointerDevices(dpy, [&] (XDeviceInfo *info) {
129 ++ int deviceid = info->id;
130 + Status status;
131 + Atom float_type = XInternAtom (dpy, "FLOAT", False);
132 + Atom type_return;
133 +@@ -106,7 +112,7 @@ void valueWriterPart<qreal>(qreal val, Atom valAtom, Display *dpy)
134 +
135 + unsigned char *_data = nullptr;
136 + //data returned is an 1 byte boolean
137 +- status = XIGetProperty(dpy, info->deviceid, valAtom, 0, 1,
138 ++ status = XIGetProperty(dpy, deviceid, valAtom, 0, 1,
139 + False, float_type, &type_return, &format_return,
140 + &num_items_return, &bytes_after_return, &_data);
141 + if (status != Success) {
142 +@@ -125,7 +131,7 @@ void valueWriterPart<qreal>(qreal val, Atom valAtom, Display *dpy)
143 + float *sendPtr = (float*)buffer;
144 + *sendPtr = val;
145 +
146 +- XIChangeProperty(dpy, info->deviceid, valAtom, float_type,
147 ++ XIChangeProperty(dpy, deviceid, valAtom, float_type,
148 + format_return, XIPropModeReplace, buffer, 1);
149 +
150 + });
151 +@@ -161,6 +167,8 @@ X11LibinputDummyDevice::X11LibinputDummyDevice(QObject *parent, Display *dpy)
152 +
153 + m_supportsNaturalScroll.val = true;
154 + m_naturalScrollEnabledByDefault.val = false;
155 ++
156 ++ s_touchpadAtom = XInternAtom(m_dpy, XI_TOUCHPAD, True);
157 + }
158 +
159 + X11LibinputDummyDevice::~X11LibinputDummyDevice()
160 +--
161 +cgit v0.11.2
162
163 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
164 new file mode 100644
165 index 00000000000..d771236bad5
166 --- /dev/null
167 +++ b/kde-plasma/plasma-desktop/plasma-desktop-5.13.5-r2.ebuild
168 @@ -0,0 +1,169 @@
169 +# Copyright 1999-2018 Gentoo Authors
170 +# Distributed under the terms of the GNU General Public License v2
171 +
172 +EAPI=6
173 +
174 +KDE_HANDBOOK="forceoptional"
175 +KDE_TEST="true"
176 +VIRTUALX_REQUIRED="test"
177 +inherit kde5
178 +
179 +DESCRIPTION="KDE Plasma desktop"
180 +KEYWORDS="~amd64 ~arm ~x86"
181 +IUSE="appstream +fontconfig ibus +mouse pulseaudio scim +semantic-desktop touchpad"
182 +
183 +COMMON_DEPEND="
184 + $(add_frameworks_dep attica)
185 + $(add_frameworks_dep kactivities)
186 + $(add_frameworks_dep kactivities-stats)
187 + $(add_frameworks_dep karchive)
188 + $(add_frameworks_dep kauth)
189 + $(add_frameworks_dep kbookmarks)
190 + $(add_frameworks_dep kcmutils)
191 + $(add_frameworks_dep kcodecs)
192 + $(add_frameworks_dep kcompletion)
193 + $(add_frameworks_dep kconfig)
194 + $(add_frameworks_dep kconfigwidgets)
195 + $(add_frameworks_dep kcoreaddons)
196 + $(add_frameworks_dep kdbusaddons)
197 + $(add_frameworks_dep kdeclarative)
198 + $(add_frameworks_dep kded)
199 + $(add_frameworks_dep kdelibs4support)
200 + $(add_frameworks_dep kemoticons)
201 + $(add_frameworks_dep kglobalaccel)
202 + $(add_frameworks_dep kguiaddons)
203 + $(add_frameworks_dep ki18n)
204 + $(add_frameworks_dep kiconthemes)
205 + $(add_frameworks_dep kio)
206 + $(add_frameworks_dep kitemmodels)
207 + $(add_frameworks_dep kitemviews)
208 + $(add_frameworks_dep kjobwidgets)
209 + $(add_frameworks_dep knewstuff)
210 + $(add_frameworks_dep knotifications)
211 + $(add_frameworks_dep knotifyconfig)
212 + $(add_frameworks_dep kparts)
213 + $(add_frameworks_dep kpeople)
214 + $(add_frameworks_dep krunner)
215 + $(add_frameworks_dep kservice)
216 + $(add_frameworks_dep kwallet)
217 + $(add_frameworks_dep kwidgetsaddons)
218 + $(add_frameworks_dep kwindowsystem)
219 + $(add_frameworks_dep kxmlgui)
220 + $(add_frameworks_dep plasma)
221 + $(add_frameworks_dep solid)
222 + $(add_frameworks_dep sonnet)
223 + $(add_plasma_dep kwin)
224 + $(add_plasma_dep plasma-workspace)
225 + $(add_qt_dep qtconcurrent)
226 + $(add_qt_dep qtdbus)
227 + $(add_qt_dep qtdeclarative)
228 + $(add_qt_dep qtgui)
229 + $(add_qt_dep qtnetwork)
230 + $(add_qt_dep qtprintsupport)
231 + $(add_qt_dep qtsql)
232 + $(add_qt_dep qtsvg)
233 + $(add_qt_dep qtwidgets)
234 + $(add_qt_dep qtx11extras)
235 + $(add_qt_dep qtxml)
236 + media-libs/phonon[qt5(+)]
237 + x11-libs/libX11
238 + x11-libs/libXcursor
239 + x11-libs/libXfixes
240 + x11-libs/libXi
241 + x11-libs/libxcb
242 + x11-libs/libxkbfile
243 + appstream? ( dev-libs/appstream[qt5] )
244 + fontconfig? (
245 + media-libs/fontconfig
246 + media-libs/freetype
247 + x11-libs/libXft
248 + x11-libs/xcb-util-image
249 + )
250 + ibus? (
251 + $(add_qt_dep qtx11extras)
252 + app-i18n/ibus
253 + dev-libs/glib:2
254 + x11-libs/libxcb
255 + x11-libs/xcb-util-keysyms
256 + )
257 + pulseaudio? (
258 + dev-libs/glib:2
259 + media-libs/libcanberra
260 + media-sound/pulseaudio
261 + )
262 + scim? ( app-i18n/scim )
263 + semantic-desktop? ( $(add_frameworks_dep baloo) )
264 + touchpad? ( x11-drivers/xf86-input-synaptics )
265 +"
266 +DEPEND="${COMMON_DEPEND}
267 + dev-libs/boost
268 + x11-base/xorg-proto
269 + fontconfig? ( x11-libs/libXrender )
270 + mouse? (
271 + x11-drivers/xf86-input-evdev
272 + x11-drivers/xf86-input-libinput
273 + )
274 +"
275 +RDEPEND="${COMMON_DEPEND}
276 + $(add_frameworks_dep qqc2-desktop-style)
277 + $(add_plasma_dep breeze)
278 + $(add_plasma_dep kde-cli-tools)
279 + $(add_plasma_dep oxygen)
280 + $(add_qt_dep qtgraphicaleffects)
281 + sys-apps/accountsservice
282 + sys-apps/util-linux
283 + x11-apps/setxkbmap
284 + pulseaudio? ( $(add_plasma_dep plasma-pa ) )
285 + !kde-apps/kcontrol
286 + !<kde-apps/kde4-l10n-17.08.1-r1
287 + !kde-apps/knetattach[handbook]
288 + !kde-misc/kcm-touchpad
289 + !kde-plasma/plasma-desktop:4
290 + !kde-plasma/plasma-workspace:4
291 + !kde-plasma/solid-actions-kcm:4
292 + !kde-plasma/systemsettings:4
293 +"
294 +
295 +PATCHES=(
296 + "${FILESDIR}/${P}-activityswitcher.patch"
297 + "${FILESDIR}/${P}-kickersearch-nav.patch"
298 + "${FILESDIR}/${P}-libinput-kcm-ignore-touchpads.patch"
299 +)
300 +
301 +src_configure() {
302 + local mycmakeargs=(
303 + $(cmake-utils_use_find_package appstream AppStreamQt)
304 + $(cmake-utils_use_find_package fontconfig Fontconfig)
305 + $(cmake-utils_use_find_package ibus IBus)
306 + $(cmake-utils_use_find_package mouse Evdev)
307 + $(cmake-utils_use_find_package mouse XorgLibinput)
308 + $(cmake-utils_use_find_package pulseaudio PulseAudio)
309 + $(cmake-utils_use_find_package scim SCIM)
310 + $(cmake-utils_use_find_package semantic-desktop KF5Baloo)
311 + $(cmake-utils_use_find_package touchpad Synaptics)
312 + )
313 +
314 + kde5_src_configure
315 +}
316 +
317 +src_test() {
318 + # parallel tests fail, foldermodeltest hangs, bug #646890
319 + # needs D-Bus, bug #634166
320 + local myctestargs=(
321 + -j1
322 + -E "(foldermodeltest|test_kio_fonts)"
323 + )
324 +
325 + kde5_src_test
326 +}
327 +
328 +pkg_postinst() {
329 + kde5_pkg_postinst
330 +
331 + if has_version "x11-libs/gtk+:2" && ! has_version "dev-libs/libappindicator:2"; then
332 + elog "For GTK+2 applications legacy-systray support, please install dev-libs/libappindicator:2."
333 + fi
334 + if has_version "x11-libs/gtk+:3" && ! has_version "dev-libs/libappindicator:3"; then
335 + elog "For GTK+3 applications legacy-systray support, please install dev-libs/libappindicator:3."
336 + fi
337 +}