diff options
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri | 7 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 20 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 12 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/xcb_qpa_lib.pro | 3 |
6 files changed, 19 insertions, 33 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri index 063a74c395..e6e352a21d 100644 --- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri +++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri @@ -5,13 +5,6 @@ INCLUDEPATH += $$PWD/../ load(qt_build_paths) -# needed by Xcursor ... -qtConfig(xcb-xlib) { - qtConfig(xinput2) { - DEFINES += XCB_USE_XINPUT2 - } -} - # build with session management support qtConfig(xcb-sm) { DEFINES += XCB_USE_SM diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 514ad6775d..cd170e3dbc 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -76,7 +76,7 @@ #include <X11/Xutil.h> #endif -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) #include <X11/extensions/XI2proto.h> #endif @@ -116,7 +116,7 @@ Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen") #define XCB_GE_GENERIC 35 #endif -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) // Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed: // - "pad0" became "extension" // - "pad1" and "pad" became "pad0" @@ -134,7 +134,7 @@ static inline bool isXIEvent(xcb_generic_event_t *event, int opCode) qt_xcb_ge_event_t *e = reinterpret_cast<qt_xcb_ge_event_t *>(event); return e->extension == opCode; } -#endif // XCB_USE_XINPUT2 +#endif // QT_CONFIG(xinput2) #if QT_CONFIG(xcb_xlib) static const char * const xcbConnectionErrors[] = { @@ -604,7 +604,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra initializeScreens(); initializeXRender(); -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) if (!qEnvironmentVariableIsSet("QT_XCB_NO_XI2")) initializeXInput2(); #endif @@ -664,7 +664,7 @@ QXcbConnection::~QXcbConnection() delete m_drag; #endif -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) finalizeXInput2(); #endif @@ -1201,7 +1201,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) } break; } -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) case XCB_GE_GENERIC: // Here the windowEventListener is invoked from xi2HandleEvent() if (m_xi2Enabled && isXIEvent(event, m_xiOpCode)) @@ -1573,7 +1573,7 @@ void *QXcbConnection::createVisualInfoForDefaultVisualId() const #endif -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) // it is safe to cast XI_* events here as long as we are only touching the first 32 bytes, // after that position event needs memmove, see xi2PrepareXIGenericDeviceEvent static inline bool isXIType(xcb_generic_event_t *event, int opCode, uint16_t type) @@ -1618,7 +1618,7 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event, int currentIndex, } return false; } -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) // compress XI_* events if (responseType == XCB_GE_GENERIC) { if (!m_xi2Enabled) @@ -2232,7 +2232,7 @@ bool QXcbConnection::xi2MouseEvents() const } #endif -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) static int xi2ValuatorOffset(const unsigned char *maskPtr, int maskLen, int number) { int offset = 0; @@ -2276,7 +2276,7 @@ void QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event) // and allow casting, overwriting the full_sequence field. memmove((char*) event + 32, (char*) event + 36, event->length * 4); } -#endif // defined(XCB_USE_XINPUT2) +#endif // QT_CONFIG(xinput2) QXcbSystemTrayTracker *QXcbConnection::systemTrayTracker() const { diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 40a54e0f1f..bba987983e 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -68,7 +68,7 @@ #include <QTabletEvent> #endif -#if XCB_USE_XINPUT2 +#if QT_CONFIG(xinput2) #include <X11/extensions/XI2.h> #ifdef XIScrollClass #define XCB_USE_XINPUT21 // XI 2.1 adds smooth scrolling support @@ -77,7 +77,7 @@ #endif #endif struct XInput2TouchDeviceData; -#endif // XCB_USE_XINPUT2 +#endif // QT_CONFIG(xinput2) struct xcb_randr_get_output_info_reply_t; @@ -426,7 +426,7 @@ public: void *createVisualInfoForDefaultVisualId() const; #endif -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) void xi2Select(xcb_window_t window); #endif #ifdef XCB_USE_XINPUT21 @@ -551,7 +551,7 @@ private: void destroyScreen(QXcbScreen *screen); void initializeScreens(); bool compressEvent(xcb_generic_event_t *event, int currentIndex, QXcbEventArray *eventqueue) const; -#ifdef XCB_USE_XINPUT2 +#if QT_CONFIG(xinput2) bool m_xi2Enabled = false; int m_xi2Minor = 2; void initializeXInput2(); @@ -636,7 +636,7 @@ private: void *m_xlib_display = nullptr; #endif QXcbEventReader *m_reader = nullptr; -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) QHash<int, XInput2TouchDeviceData*> m_touchDevices; #ifdef XCB_USE_XINPUT22 struct StartSystemResizeInfo { @@ -694,7 +694,7 @@ private: friend class QXcbEventReader; }; -#ifdef XCB_USE_XINPUT2 +#if QT_CONFIG(xinput2) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 52873f0910..4d2a83b3cf 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -47,8 +47,6 @@ #include <QDebug> #include <cmath> -#ifdef XCB_USE_XINPUT2 - #include <X11/extensions/XInput2.h> #include <X11/extensions/XI2proto.h> @@ -698,10 +696,8 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo if (m_xiGrab) { // XIAllowTouchEvents deadlocks with libXi < 1.7.4 (this has nothing to do with the XI2 versions like 2.2) // http://lists.x.org/archives/xorg-devel/2014-July/043059.html -#ifdef XCB_USE_XINPUT2 XIAllowTouchEvents(static_cast<Display *>(m_xlib_display), xiDeviceEvent->deviceid, xiDeviceEvent->detail, xiDeviceEvent->event, XIAcceptTouch); -#endif } break; case XI_TouchUpdate: @@ -1241,5 +1237,3 @@ QXcbConnection::TabletData *QXcbConnection::tabletDataForDevice(int id) } #endif // QT_CONFIG(tabletevent) - -#endif // XCB_USE_XINPUT2 diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 31757ca6f6..4acc827bf6 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -104,7 +104,7 @@ #include <X11/Xutil.h> #endif -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) #include <X11/extensions/XInput2.h> #include <X11/extensions/XI2proto.h> #endif @@ -558,7 +558,7 @@ void QXcbWindow::create() 32, 2, (void *)data)); -#if defined(XCB_USE_XINPUT2) +#if QT_CONFIG(xinput2) connection()->xi2Select(m_window); #endif diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index 6c9a3259b6..d0dc8f3075 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -48,12 +48,11 @@ HEADERS = \ load(qt_build_paths) DEFINES += QT_BUILD_XCB_PLUGIN -# needed by Xcursor ... + qtConfig(xcb-xlib) { QMAKE_USE += xcb_xlib qtConfig(xinput2) { - DEFINES += XCB_USE_XINPUT2 SOURCES += qxcbconnection_xi2.cpp QMAKE_USE += xinput2 } |