summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-10-06 14:51:36 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-10-10 16:59:26 +0000
commitb4085e56b9040247393b279f64b8cd63af863798 (patch)
tree6bc5f284d0d2427ebc0bf40a1075b7f6fea22203 /src
parent573fbd84a49b9e82c4fc8f17952a809f9fed889d (diff)
Migrate libinput support away from QT_LIBRARY_VERSION
There may not be a version when libinput is not picked up via pkg-config. Add a config test instead. Task-number: QTBUG-56017 Change-Id: I421af4cef1b896413a4ebda561809a8b2a3386b3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/configure.json11
-rw-r--r--src/platformsupport/input/libinput/qlibinputpointer.cpp2
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/configure.json b/src/gui/configure.json
index d3e32e6796..d8969a1e4e 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -356,6 +356,12 @@
"type": "compile",
"test": "unix/evdev"
},
+ "libinput_axis_api": {
+ "label": "axis API in libinput",
+ "type": "compile",
+ "test": "unix/libinput_axis_api",
+ "use": "libinput"
+ },
"linuxfb": {
"label": "LinuxFB",
"type": "compile",
@@ -499,6 +505,11 @@
"condition": "features.libudev && libs.libinput",
"output": [ "privateFeature" ]
},
+ "libinput-axis-api": {
+ "label": "axis API in libinput",
+ "condition": "tests.libinput_axis_api",
+ "output": [ "privateFeature" ]
+ },
"lgmon": {
"label": "lgmon",
"emitIf": "config.qnx",
diff --git a/src/platformsupport/input/libinput/qlibinputpointer.cpp b/src/platformsupport/input/libinput/qlibinputpointer.cpp
index 3b583ec99d..bdeac8db7e 100644
--- a/src/platformsupport/input/libinput/qlibinputpointer.cpp
+++ b/src/platformsupport/input/libinput/qlibinputpointer.cpp
@@ -96,7 +96,7 @@ void QLibInputPointer::processMotion(libinput_event_pointer *e)
void QLibInputPointer::processAxis(libinput_event_pointer *e)
{
-#if QT_LIBRARY_VERSION(libinput) < QT_VERSION_CHECK(0, 8, 0)
+#if !QT_CONFIG(libinput_axis_api)
const double v = libinput_event_pointer_get_axis_value(e) * 120;
const Qt::Orientation ori = libinput_event_pointer_get_axis(e) == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL
? Qt::Vertical : Qt::Horizontal;