summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 730473b983..52873f0910 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -100,7 +100,7 @@ void QXcbConnection::initializeXInput2()
void QXcbConnection::xi2SetupDevices()
{
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
m_tabletData.clear();
#endif
m_scrollingDevices.clear();
@@ -116,7 +116,7 @@ void QXcbConnection::xi2SetupDevices()
if (devices[i].use != XISlavePointer)
continue;
qCDebug(lcQpaXInputDevices) << "input device " << devices[i].name << "ID" << devices[i].deviceid;
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
TabletData tabletData;
#endif
ScrollingDevice scrollingDevice;
@@ -126,7 +126,7 @@ void QXcbConnection::xi2SetupDevices()
XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(devices[i].classes[c]);
const int valuatorAtom = qatom(vci->label);
qCDebug(lcQpaXInputDevices) << " has valuator" << atomName(vci->label) << "recognized?" << (valuatorAtom < QXcbAtom::NAtoms);
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
if (valuatorAtom < QXcbAtom::NAtoms) {
TabletData::ValuatorClassInfo info;
info.minVal = vci->min;
@@ -134,7 +134,7 @@ void QXcbConnection::xi2SetupDevices()
info.number = vci->number;
tabletData.valuatorInfo[valuatorAtom] = info;
}
-#endif // QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel)
scrollingDevice.lastScrollPosition.setX(vci->value);
else if (valuatorAtom == QXcbAtom::RelVertScroll || valuatorAtom == QXcbAtom::RelVertWheel)
@@ -191,7 +191,7 @@ void QXcbConnection::xi2SetupDevices()
}
}
bool isTablet = false;
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
// If we have found the valuators which we expect a tablet to have, it might be a tablet.
if (tabletData.valuatorInfo.contains(QXcbAtom::AbsX) &&
tabletData.valuatorInfo.contains(QXcbAtom::AbsY) &&
@@ -241,7 +241,7 @@ void QXcbConnection::xi2SetupDevices()
m_tabletData.append(tabletData);
qCDebug(lcQpaXInputDevices) << " it's a tablet with pointer type" << dbgType;
}
-#endif // QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21
if (scrollingDevice.orientations || scrollingDevice.legacyOrientations) {
@@ -330,7 +330,7 @@ void QXcbConnection::xi2Select(xcb_window_t window)
#endif // XCB_USE_XINPUT22
QSet<int> tabletDevices;
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
if (!m_tabletData.isEmpty()) {
unsigned int tabletBitMask;
unsigned char *xiTabletBitMask = reinterpret_cast<unsigned char *>(&tabletBitMask);
@@ -347,7 +347,7 @@ void QXcbConnection::xi2Select(xcb_window_t window)
}
XISelectEvents(xDisplay, window, xiEventMask.data(), m_tabletData.count());
}
-#endif // QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21
// Enable each scroll device
@@ -482,12 +482,12 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id)
return dev;
}
-#if defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT)
+#if defined(XCB_USE_XINPUT21) || QT_CONFIG(tabletevent)
static inline qreal fixed1616ToReal(FP1616 val)
{
return qreal(val) / 0x10000;
}
-#endif // defined(XCB_USE_XINPUT21) || !defined(QT_NO_TABLETEVENT)
+#endif // defined(XCB_USE_XINPUT21) || QT_CONFIG(tabletevent)
void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
{
@@ -536,13 +536,13 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
return;
}
-#ifndef QT_NO_TABLETEVENT
+#if QT_CONFIG(tabletevent)
if (!xiEnterEvent) {
QXcbConnection::TabletData *tablet = tabletDataForDevice(sourceDeviceId);
if (tablet && xi2HandleTabletEvent(xiEvent, tablet))
return;
}
-#endif // QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
#ifdef XCB_USE_XINPUT21
QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(sourceDeviceId);
@@ -1240,6 +1240,6 @@ QXcbConnection::TabletData *QXcbConnection::tabletDataForDevice(int id)
return Q_NULLPTR;
}
-#endif // QT_NO_TABLETEVENT
+#endif // QT_CONFIG(tabletevent)
#endif // XCB_USE_XINPUT2