Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtgui/files/, dev-qt/qtgui/
Date: Thu, 08 Feb 2018 00:10:44
Message-Id: 1518048073.fbc5f96d8e4520254f41f380b7f603495231fb1a.asturm@gentoo
1 commit: fbc5f96d8e4520254f41f380b7f603495231fb1a
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 7 15:56:18 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 8 00:01:13 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbc5f96d
7
8 dev-qt/qtgui: Fix libinput wheelevents
9
10 Patch taken from 5.9 branch (fixed in 5.9.5).
11
12 KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=386762
13 Qt-Bug: https://bugreports.qt.io/browse/QTBUG-59261
14 See also: https://codereview.qt-project.org/#/c/212398/
15
16 Package-Manager: Portage-2.3.24, Repoman-2.3.6
17 Closes: https://github.com/gentoo/gentoo/pull/7109
18
19 .../files/qtgui-5.9.4-libinput-pixeldelta.patch | 68 ++++++++
20 dev-qt/qtgui/qtgui-5.9.4-r2.ebuild | 174 +++++++++++++++++++++
21 2 files changed, 242 insertions(+)
22
23 diff --git a/dev-qt/qtgui/files/qtgui-5.9.4-libinput-pixeldelta.patch b/dev-qt/qtgui/files/qtgui-5.9.4-libinput-pixeldelta.patch
24 new file mode 100644
25 index 00000000000..b9adb8b2f62
26 --- /dev/null
27 +++ b/dev-qt/qtgui/files/qtgui-5.9.4-libinput-pixeldelta.patch
28 @@ -0,0 +1,68 @@
29 +From d196036024697a75868c1f1626525710495ca428 Mon Sep 17 00:00:00 2001
30 +From: Allan Sandfeld Jensen <allan.jensen@××.io>
31 +Date: Thu, 23 Nov 2017 14:25:04 +0100
32 +Subject: [PATCH] Avoid providing bad pixelDeltas on X11
33 +
34 +With libinput we now get a hardcoded resolution that is unrelated to
35 +the hardware. So avoid using that as a real pixel delta and document
36 +pixel deltas as being driver specific and unreliable on X11.
37 +
38 +Task-number: QTBUG-59261
39 +Change-Id: I9fe86d80e7ccd290ed2e4091d7eafa52cb537d34
40 +Reviewed-by: David Edmundson <davidedmundson@×××.org>
41 +Reviewed-by: Marco Martin <mart@×××.org>
42 +Reviewed-by: Gatis Paeglis <gatis.paeglis@××.io>
43 +---
44 + src/gui/kernel/qevent.cpp | 1 +
45 + src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 14 ++++++++------
46 + 2 files changed, 9 insertions(+), 6 deletions(-)
47 +
48 +diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
49 +index 06d52aa..c68f9af 100644
50 +--- a/src/gui/kernel/qevent.cpp
51 ++++ b/src/gui/kernel/qevent.cpp
52 +@@ -971,6 +971,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
53 + \li scrolling is about to begin, but the distance did not yet change (Qt::ScrollBegin),
54 + \li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd).
55 + \endlist
56 ++ \note On X11 this value is driver specific and unreliable, use angleDelta() instead
57 + */
58 +
59 + /*!
60 +diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
61 +index d1d97af..94f543f 100644
62 +--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
63 ++++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
64 +@@ -953,10 +953,12 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
65 + double delta = scrollingDevice.lastScrollPosition.y() - value;
66 + scrollingDevice.lastScrollPosition.setY(value);
67 + angleDelta.setY((delta / scrollingDevice.verticalIncrement) * 120);
68 +- // We do not set "pixel" delta if it is only measured in ticks.
69 +- if (scrollingDevice.verticalIncrement > 1)
70 ++ // With most drivers the increment is 1 for wheels.
71 ++ // For libinput it is hardcoded to a useless 15.
72 ++ // For a proper touchpad driver it should be in the same order of magnitude as 120
73 ++ if (scrollingDevice.verticalIncrement > 15)
74 + rawDelta.setY(delta);
75 +- else if (scrollingDevice.verticalIncrement < -1)
76 ++ else if (scrollingDevice.verticalIncrement < -15)
77 + rawDelta.setY(-delta);
78 + }
79 + }
80 +@@ -965,10 +967,10 @@ void QXcbConnection::xi2HandleScrollEvent(void *event, ScrollingDevice &scrollin
81 + double delta = scrollingDevice.lastScrollPosition.x() - value;
82 + scrollingDevice.lastScrollPosition.setX(value);
83 + angleDelta.setX((delta / scrollingDevice.horizontalIncrement) * 120);
84 +- // We do not set "pixel" delta if it is only measured in ticks.
85 +- if (scrollingDevice.horizontalIncrement > 1)
86 ++ // See comment under vertical
87 ++ if (scrollingDevice.horizontalIncrement > 15)
88 + rawDelta.setX(delta);
89 +- else if (scrollingDevice.horizontalIncrement < -1)
90 ++ else if (scrollingDevice.horizontalIncrement < -15)
91 + rawDelta.setX(-delta);
92 + }
93 + }
94 +--
95 +2.7.4
96 +
97
98 diff --git a/dev-qt/qtgui/qtgui-5.9.4-r2.ebuild b/dev-qt/qtgui/qtgui-5.9.4-r2.ebuild
99 new file mode 100644
100 index 00000000000..35f85253ada
101 --- /dev/null
102 +++ b/dev-qt/qtgui/qtgui-5.9.4-r2.ebuild
103 @@ -0,0 +1,174 @@
104 +# Copyright 1999-2018 Gentoo Foundation
105 +# Distributed under the terms of the GNU General Public License v2
106 +
107 +EAPI=6
108 +QT5_MODULE="qtbase"
109 +inherit qt5-build
110 +
111 +DESCRIPTION="The GUI module and platform plugins for the Qt5 framework"
112 +
113 +if [[ ${QT5_BUILD_TYPE} == release ]]; then
114 + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86"
115 +fi
116 +
117 +# TODO: linuxfb
118 +
119 +IUSE="accessibility dbus egl eglfs evdev +gif gles2 ibus
120 + jpeg +libinput +png tslib tuio +udev vnc +xcb"
121 +REQUIRED_USE="
122 + || ( eglfs xcb )
123 + accessibility? ( dbus xcb )
124 + eglfs? ( egl )
125 + ibus? ( dbus )
126 + libinput? ( udev )
127 + xcb? ( gles2? ( egl ) )
128 +"
129 +
130 +RDEPEND="
131 + dev-libs/glib:2
132 + ~dev-qt/qtcore-${PV}
133 + media-libs/fontconfig
134 + >=media-libs/freetype-2.6.1:2
135 + >=media-libs/harfbuzz-1.0.6:=
136 + >=sys-libs/zlib-1.2.5
137 + virtual/opengl
138 + dbus? ( ~dev-qt/qtdbus-${PV} )
139 + egl? ( media-libs/mesa[egl] )
140 + eglfs? (
141 + media-libs/mesa[gbm]
142 + x11-libs/libdrm
143 + )
144 + evdev? ( sys-libs/mtdev )
145 + gles2? ( media-libs/mesa[gles2] )
146 + jpeg? ( virtual/jpeg:0 )
147 + libinput? (
148 + dev-libs/libinput:=
149 + x11-libs/libxkbcommon
150 + )
151 + png? ( media-libs/libpng:0= )
152 + tslib? ( x11-libs/tslib )
153 + tuio? ( ~dev-qt/qtnetwork-${PV} )
154 + udev? ( virtual/libudev:= )
155 + vnc? ( ~dev-qt/qtnetwork-${PV} )
156 + xcb? (
157 + x11-libs/libICE
158 + x11-libs/libSM
159 + x11-libs/libX11
160 + >=x11-libs/libXi-1.7.5
161 + >=x11-libs/libxcb-1.10:=[xkb]
162 + >=x11-libs/libxkbcommon-0.4.1[X]
163 + x11-libs/xcb-util-image
164 + x11-libs/xcb-util-keysyms
165 + x11-libs/xcb-util-renderutil
166 + x11-libs/xcb-util-wm
167 + )
168 +"
169 +DEPEND="${RDEPEND}
170 + evdev? ( sys-kernel/linux-headers )
171 + udev? ( sys-kernel/linux-headers )
172 +"
173 +PDEPEND="
174 + ibus? ( app-i18n/ibus )
175 +"
176 +
177 +PATCHES=(
178 + "${FILESDIR}/${P}-qsimpledrag.patch" # QTBUG-66103
179 + "${FILESDIR}/${P}-libinput-pixeldelta.patch" # QTBUG-59261
180 +)
181 +
182 +QT5_TARGET_SUBDIRS=(
183 + src/gui
184 + src/openglextensions
185 + src/platformheaders
186 + src/platformsupport
187 + src/plugins/generic
188 + src/plugins/imageformats
189 + src/plugins/platforms
190 + src/plugins/platforminputcontexts
191 +)
192 +
193 +QT5_GENTOO_CONFIG=(
194 + accessibility:accessibility-atspi-bridge
195 + egl
196 + eglfs
197 + eglfs:eglfs_egldevice:
198 + eglfs:eglfs_gbm:
199 + evdev
200 + evdev:mtdev:
201 + :fontconfig
202 + :system-freetype:FREETYPE
203 + !:no-freetype:
204 + !gif:no-gif:
205 + gles2::OPENGL_ES
206 + gles2:opengles2:OPENGL_ES_2
207 + !:no-gui:
208 + :system-harfbuzz:HARFBUZZ
209 + !:no-harfbuzz:
210 + jpeg:system-jpeg:IMAGEFORMAT_JPEG
211 + !jpeg:no-jpeg:
212 + libinput
213 + libinput:xkbcommon-evdev:
214 + :opengl
215 + png:png:
216 + png:system-png:IMAGEFORMAT_PNG
217 + !png:no-png:
218 + tslib
219 + udev:libudev:
220 + xcb:xcb:
221 + xcb:xcb-glx:
222 + xcb:xcb-plugin:
223 + xcb:xcb-render:
224 + xcb:xcb-sm:
225 + xcb:xcb-xlib:
226 + xcb:xinput2:
227 + xcb::XKB
228 +)
229 +
230 +QT5_GENTOO_PRIVATE_CONFIG=(
231 + :gui
232 +)
233 +
234 +src_prepare() {
235 + # egl_x11 is activated when both egl and xcb are enabled
236 + use egl && QT5_GENTOO_CONFIG+=(xcb:egl_x11) || QT5_GENTOO_CONFIG+=(egl:egl_x11)
237 +
238 + qt_use_disable_config dbus dbus \
239 + src/platformsupport/themes/genericunix/genericunix.pri
240 +
241 + qt_use_disable_config tuio udpsocket src/plugins/generic/generic.pro
242 +
243 + qt_use_disable_mod ibus dbus \
244 + src/plugins/platforminputcontexts/platforminputcontexts.pro
245 +
246 + use vnc || sed -i -e '/SUBDIRS += vnc/d' \
247 + src/plugins/platforms/platforms.pro || die
248 +
249 + qt5-build_src_prepare
250 +}
251 +
252 +src_configure() {
253 + local myconf=(
254 + $(usex dbus -dbus-linked '')
255 + $(qt_use egl)
256 + $(qt_use eglfs)
257 + $(usex eglfs '-gbm -kms' '')
258 + $(qt_use evdev)
259 + $(qt_use evdev mtdev)
260 + -fontconfig
261 + -system-freetype
262 + $(usex gif '' -no-gif)
263 + -gui
264 + -system-harfbuzz
265 + $(qt_use jpeg libjpeg system)
266 + $(qt_use libinput)
267 + $(qt_use libinput xkbcommon-evdev)
268 + -opengl $(usex gles2 es2 desktop)
269 + $(qt_use png libpng system)
270 + $(qt_use tslib)
271 + $(qt_use udev libudev)
272 + $(qt_use xcb xcb system)
273 + $(qt_use xcb xkbcommon-x11 system)
274 + $(usex xcb '-xcb-xlib -xinput2 -xkb' '')
275 + )
276 + qt5-build_src_configure
277 +}