From 60588e1a5dd9b10803e078c741271cbe5713a51b Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 19 Feb 2019 10:09:19 +0100 Subject: 3rdparty: remove xcb libs and bump minimal required version to 1.11 With libxcb 1.11 as minimal required version we can: (a) (Maybe) Enable threaded GL for MESA, see QTBUG-67277. (b) Avoid performance issues described in QTBUG-46017. Bundled xcb libs don't contain the more modern SHM fd passing APIs. The official binaries use "-qt-xcb", therefore we were shipping with the performance fix #ifdef-ed out. (c) Make xcb-xkb a mandatory dependency avoiding issues described in QTBUG-30911. Issues that appear when Qt was configure with "-no-xkb -xcb-xlib", but X server has the XKB extension. (d) Drop all, but xcb-xinput sources from src/3rdparty/xcb/, for which we need "xcb-xinput >= 1.12". This way we can reduce maintenance work. The xcb libraries were origianlly bundled because of lack of availability on supported distributions. This is not the case anymore: CI for Qt 5.13 has: Ubuntu 18.04 - libxcb 1.13 RHEL 7.4 - libxcb 1.13 openSUSE 15.0 - libxcb 1.13 CI for Qt 5.12 has: Ubuntu 16.04 - libxcb 1.11 RHEL 7.4 - libxcb 1.13 openSUSE 42.3 - libxcb 1.11 RHEL 6.x - not relevant because it was dropped from supported platforms. Why 1.11 (released on Aug, 2014), but not 1.13 (released on March 2018)? Based on what we have in CI for 5.13 and 5.14 we could update to 1.13, but it means that Qt would require a very recent version of 3rd party dependency. [ChangeLog][Configure][X11] The minimal required version of libxcb now is 1.11. [ChangeLog][Third-Party Code][X11] Removed all bundled XCB libs, with the exception of xcb-xinput, which is not available on systems with libxcb 1.11. [ChangeLog][Configure][X11] Removed -qt-xcb, -system-xcb, -xkb, -xcb-xinput switches. [ChangeLog][Platform Specific Changes][X11] XKB and XInput2 now are mandatory dependencies for XCB plugin. XCB-XKB is a part of libxcb 1.11 releases. XCB-XInput is not part of libxcb 1.11 releases, but Qt builders can use -bundled-xcb-xinput switch. Fixes: QTBUG-73862 Fixes: QTBUG-73888 Task-number: QTBUG-67277 Task-number: QTBUG-30939 Change-Id: I4c2bd2a0e667220d32fd1fbfa1419c844f17fcce Reviewed-by: Lars Knoll --- src/plugins/platforms/xcb/qxcbconnection.cpp | 26 ------- src/plugins/platforms/xcb/qxcbconnection.h | 8 --- src/plugins/platforms/xcb/qxcbconnection_basic.cpp | 21 +----- src/plugins/platforms/xcb/qxcbconnection_basic.h | 6 -- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 25 +------ src/plugins/platforms/xcb/qxcbkeyboard.h | 20 ++---- src/plugins/platforms/xcb/qxcbwindow.cpp | 26 +------ src/plugins/platforms/xcb/qxcbwindow.h | 2 - .../platforms/xcb/xcb-static/xcb-static.pro | 80 ---------------------- src/plugins/platforms/xcb/xcb.pro | 2 - src/plugins/platforms/xcb/xcb_qpa_lib.pro | 30 ++++---- 11 files changed, 23 insertions(+), 223 deletions(-) delete mode 100644 src/plugins/platforms/xcb/xcb-static/xcb-static.pro (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index cac6345b66..e51c3d0502 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -66,14 +66,10 @@ #include #include -#if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit -#endif -#if QT_CONFIG(xcb_xinput) #include -#endif QT_BEGIN_NAMESPACE @@ -88,12 +84,6 @@ Q_LOGGING_CATEGORY(lcQpaKeyboard, "qt.qpa.xkeyboard") Q_LOGGING_CATEGORY(lcQpaClipboard, "qt.qpa.clipboard") Q_LOGGING_CATEGORY(lcQpaXDnd, "qt.qpa.xdnd") -// this event type was added in libxcb 1.10, -// but we support also older version -#ifndef XCB_GE_GENERIC -#define XCB_GE_GENERIC 35 -#endif - QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, xcb_visualid_t defaultVisualId, const char *displayName) : QXcbBasicConnection(displayName) , m_canGrabServer(canGrabServer) @@ -112,12 +102,10 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra initializeScreens(); -#if QT_CONFIG(xcb_xinput) if (hasXInput2()) { xi2SetupDevices(); xi2SelectStateEvents(); } -#endif m_wmSupport.reset(new QXcbWMSupport(this)); m_keyboard = new QXcbKeyboard(this); @@ -518,7 +506,6 @@ Qt::MouseButton QXcbConnection::translateMouseButton(xcb_button_t s) } } -#if QT_CONFIG(xkb) namespace { typedef union { /* All XKB events share these fields. */ @@ -534,7 +521,6 @@ namespace { xcb_xkb_state_notify_event_t state_notify; } _xkb_event; } -#endif void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) { @@ -611,16 +597,12 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) HANDLE_PLATFORM_WINDOW_EVENT(xcb_client_message_event_t, window, handleClientMessageEvent); } case XCB_ENTER_NOTIFY: -#if QT_CONFIG(xcb_xinput) if (hasXInput2() && !xi2MouseEventsDisabled()) break; -#endif HANDLE_PLATFORM_WINDOW_EVENT(xcb_enter_notify_event_t, event, handleEnterNotifyEvent); case XCB_LEAVE_NOTIFY: -#if QT_CONFIG(xcb_xinput) if (hasXInput2() && !xi2MouseEventsDisabled()) break; -#endif m_keyboard->updateXKBStateFromCore(reinterpret_cast(event)->state); HANDLE_PLATFORM_WINDOW_EVENT(xcb_leave_notify_event_t, event, handleLeaveNotifyEvent); case XCB_FOCUS_IN: @@ -682,13 +664,11 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) } break; } -#if QT_CONFIG(xcb_xinput) case XCB_GE_GENERIC: // Here the windowEventListener is invoked from xi2HandleEvent() if (hasXInput2() && isXIEvent(event)) xi2HandleEvent(reinterpret_cast(event)); break; -#endif default: handled = false; // event type not recognized break; @@ -712,7 +692,6 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) auto change_event = reinterpret_cast(event); if (auto virtualDesktop = virtualDesktopForRootWindow(change_event->root)) virtualDesktop->handleScreenChange(change_event); -#if QT_CONFIG(xkb) } else if (isXkbType(response_type)) { auto xkb_event = reinterpret_cast<_xkb_event *>(event); if (xkb_event->any.deviceID == m_keyboard->coreDeviceId()) { @@ -735,7 +714,6 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) break; } } -#endif } else { handled = false; // event type still not recognized } @@ -912,7 +890,6 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event) const }); } -#if QT_CONFIG(xcb_xinput) // compress XI_* events if (responseType == XCB_GE_GENERIC) { if (!hasXInput2()) @@ -948,7 +925,6 @@ bool QXcbConnection::compressEvent(xcb_generic_event_t *event) const return false; } -#endif if (responseType == XCB_CONFIGURE_NOTIFY) { // compress multiple configure notify events for the same window @@ -978,7 +954,6 @@ bool QXcbConnection::isUserInputEvent(xcb_generic_event_t *event) const if (isInputEvent) return true; -#if QT_CONFIG(xcb_xinput) if (connection()->hasXInput2()) { isInputEvent = isXIType(event, XCB_INPUT_BUTTON_PRESS) || isXIType(event, XCB_INPUT_BUTTON_RELEASE) || @@ -993,7 +968,6 @@ bool QXcbConnection::isUserInputEvent(xcb_generic_event_t *event) const } if (isInputEvent) return true; -#endif if (eventType == XCB_CLIENT_MESSAGE) { auto clientMessage = reinterpret_cast(event); diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 7cf25d41a6..a894944096 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -104,10 +104,8 @@ public: virtual void handleFocusInEvent(const xcb_focus_in_event_t *) {} virtual void handleFocusOutEvent(const xcb_focus_out_event_t *) {} virtual void handlePropertyNotifyEvent(const xcb_property_notify_event_t *) {} -#if QT_CONFIG(xcb_xinput) virtual void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource = Qt::MouseEventNotSynthesized) {} virtual void handleXIEnterLeave(xcb_ge_event_t *) {} -#endif virtual QXcbWindow *toWindow() { return nullptr; } }; @@ -225,7 +223,6 @@ public: bool isUserInputEvent(xcb_generic_event_t *event) const; -#if QT_CONFIG(xcb_xinput) void xi2SelectStateEvents(); void xi2SelectDeviceEvents(xcb_window_t window); void xi2SelectDeviceEventsCompatibility(xcb_window_t window); @@ -236,7 +233,6 @@ public: bool startSystemMoveResizeForTouchBegin(xcb_window_t window, const QPoint &point, int corner); void abortSystemMoveResizeForTouch(); bool isTouchScreen(int id); -#endif bool canGrab() const { return m_canGrabServer; } @@ -267,7 +263,6 @@ private: inline bool timeGreaterThan(xcb_timestamp_t a, xcb_timestamp_t b) const { return static_cast(a - b) > 0 || b == XCB_CURRENT_TIME; } -#if QT_CONFIG(xcb_xinput) void xi2SetupDevice(void *info, bool removeExisting = true); void xi2SetupDevices(); struct TouchDeviceData { @@ -341,7 +336,6 @@ private: uint32_t pointid; int corner; } m_startSystemMoveResizeInfo; -#endif // QT_CONFIG(xcb_xinput) const bool m_canGrabServer; const xcb_visualid_t m_defaultVisualId; @@ -389,12 +383,10 @@ private: QTimer m_focusInTimer; }; -#if QT_CONFIG(xcb_xinput) #if QT_CONFIG(tabletevent) Q_DECLARE_TYPEINFO(QXcbConnection::TabletData::ValuatorClassInfo, Q_PRIMITIVE_TYPE); Q_DECLARE_TYPEINFO(QXcbConnection::TabletData, Q_MOVABLE_TYPE); #endif -#endif class QXcbConnectionGrabber { diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp index 9a028e5a7e..1ba4b4a1b9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp @@ -45,14 +45,10 @@ #include #include #include -#if QT_CONFIG(xcb_xinput) #include -#endif -#if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit -#endif #if QT_CONFIG(xcb_xlib) #define register /* C++17 deprecated register */ @@ -138,14 +134,7 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName) xcb_extension_t *extensions[] = { &xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id, - &xcb_render_id, -#if QT_CONFIG(xkb) - &xcb_xkb_id, -#endif -#if QT_CONFIG(xcb_xinput) - &xcb_input_id, -#endif - 0 + &xcb_render_id, &xcb_xkb_id, &xcb_input_id, 0 }; for (xcb_extension_t **ext_it = extensions; *ext_it; ++ext_it) @@ -160,10 +149,8 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName) initializeXinerama(); initializeXFixes(); initializeXRender(); -#if QT_CONFIG(xcb_xinput) if (!qEnvironmentVariableIsSet("QT_XCB_NO_XI2")) initializeXInput2(); -#endif initializeXShape(); initializeXKB(); } @@ -213,7 +200,6 @@ bool QXcbBasicConnection::hasBigRequest() const return m_maximumRequestLength > m_setup->maximum_request_length; } -#if QT_CONFIG(xcb_xinput) // Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed: // - "pad0" became "extension" // - "pad1" and "pad" became "pad0" @@ -240,7 +226,6 @@ bool QXcbBasicConnection::isXIType(xcb_generic_event_t *event, uint16_t type) co auto *e = reinterpret_cast(event); return e->event_type == type; } -#endif // QT_CONFIG(xcb_xinput) bool QXcbBasicConnection::isXFixesType(uint responseType, int eventType) const { @@ -370,7 +355,6 @@ void QXcbBasicConnection::initializeXRandr() m_xrandrFirstEvent = reply->first_event; } -#if QT_CONFIG(xcb_xinput) void QXcbBasicConnection::initializeXInput2() { const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_input_id); @@ -393,7 +377,6 @@ void QXcbBasicConnection::initializeXInput2() m_xinputFirstEvent = reply->first_event; m_xi2Minor = xinputQuery->minor_version; } -#endif void QXcbBasicConnection::initializeXShape() { @@ -417,7 +400,6 @@ void QXcbBasicConnection::initializeXShape() void QXcbBasicConnection::initializeXKB() { -#if QT_CONFIG(xkb) const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_xkb_id); if (!reply || !reply->present) { qCWarning(lcQpaXcb, "XKeyboard extension not present on the X server"); @@ -439,7 +421,6 @@ void QXcbBasicConnection::initializeXKB() m_hasXkb = true; m_xkbFirstEvent = reply->first_event; -#endif } QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.h b/src/plugins/platforms/xcb/qxcbconnection_basic.h index 1bd4310562..109186f966 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_basic.h +++ b/src/plugins/platforms/xcb/qxcbconnection_basic.h @@ -99,12 +99,10 @@ public: bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; -#if QT_CONFIG(xcb_xinput) bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI22() const { return m_xi2Enabled && m_xi2Minor >= 2; } bool isXIEvent(xcb_generic_event_t *event) const; bool isXIType(xcb_generic_event_t *event, uint16_t type) const; -#endif bool isXFixesType(uint responseType, int eventType) const; bool isXRandrType(uint responseType, int eventType) const; @@ -119,9 +117,7 @@ protected: void initializeXShape(); void initializeXKB(); void initializeXSync(); -#if QT_CONFIG(xcb_xinput) void initializeXInput2(); -#endif private: #if QT_CONFIG(xcb_xlib) @@ -147,11 +143,9 @@ private: QPair m_xrenderVersion; bool m_xi2Enabled = false; -#if QT_CONFIG(xcb_xinput) int m_xi2Minor = -1; int m_xiOpCode = -1; uint32_t m_xinputFirstEvent = 0; -#endif uint32_t m_xfixesFirstEvent = 0; uint32_t m_xrandrFirstEvent = 0; diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index d0e02ecdd1..3caee3f409 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -49,13 +49,7 @@ #include -#if QT_CONFIG(xkb) -#include -#endif - -#if QT_CONFIG(xcb_xinput) #include -#endif QT_BEGIN_NAMESPACE @@ -392,20 +386,16 @@ void QXcbKeyboard::updateKeymap() xkb_context_set_log_level(m_xkbContext.get(), logLevel); } -#if QT_CONFIG(xkb) if (connection()->hasXKB()) { m_xkbKeymap.reset(xkb_x11_keymap_new_from_device(m_xkbContext.get(), xcb_connection(), core_device_id, XKB_KEYMAP_COMPILE_NO_FLAGS)); if (m_xkbKeymap) m_xkbState.reset(xkb_x11_state_new_from_device(m_xkbKeymap.get(), xcb_connection(), core_device_id)); } else { -#endif m_xkbKeymap.reset(keymapFromCore(keysymMods)); if (m_xkbKeymap) m_xkbState.reset(xkb_state_new(m_xkbKeymap.get())); -#if QT_CONFIG(xkb) } -#endif if (!m_xkbKeymap) { qCWarning(lcQpaKeyboard, "failed to compile a keymap"); @@ -428,7 +418,6 @@ QList QXcbKeyboard::possibleKeys(const QKeyEvent *event) const return QXkbCommon::possibleKeys(m_xkbState.get(), event, m_superAsMeta, m_hyperAsMeta); } -#if QT_CONFIG(xkb) void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state) { if (m_config && connection()->hasXKB()) { @@ -444,7 +433,6 @@ void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state) handleStateChanges(changedComponents); } } -#endif static xkb_layout_index_t lockedGroup(quint16 state) { @@ -473,7 +461,6 @@ void QXcbKeyboard::updateXKBStateFromCore(quint16 state) } } -#if QT_CONFIG(xcb_xinput) void QXcbKeyboard::updateXKBStateFromXI(void *modInfo, void *groupInfo) { if (m_config && !connection()->hasXKB()) { @@ -491,7 +478,6 @@ void QXcbKeyboard::updateXKBStateFromXI(void *modInfo, void *groupInfo) handleStateChanges(changedComponents); } } -#endif void QXcbKeyboard::handleStateChanges(xkb_state_component changedComponents) { @@ -541,7 +527,6 @@ void QXcbKeyboard::updateXKBMods() QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection) : QXcbObject(connection) { -#if QT_CONFIG(xkb) core_device_id = 0; if (connection->hasXKB()) { selectEvents(); @@ -551,11 +536,9 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection) return; } } else { -#endif m_key_symbols = xcb_key_symbols_alloc(xcb_connection()); -#if QT_CONFIG(xkb) } -#endif + updateKeymap(); } @@ -573,7 +556,6 @@ void QXcbKeyboard::initialize() void QXcbKeyboard::selectEvents() { -#if QT_CONFIG(xkb) const uint16_t required_map_parts = (XCB_XKB_MAP_PART_KEY_TYPES | XCB_XKB_MAP_PART_KEY_SYMS | XCB_XKB_MAP_PART_MODIFIER_MAP | @@ -604,12 +586,10 @@ void QXcbKeyboard::selectEvents() free(error); qCWarning(lcQpaXcb, "failed to select notify events from XKB"); } -#endif } void QXcbKeyboard::updateVModMapping() { -#if QT_CONFIG(xkb) xcb_xkb_get_names_value_list_t names_list; memset(&vmod_masks, 0, sizeof(vmod_masks)); @@ -667,12 +647,10 @@ void QXcbKeyboard::updateVModMapping() else if (qstrcmp(vmod_name, "Hyper") == 0) vmod_masks.hyper = bit; } -#endif } void QXcbKeyboard::updateVModToRModMapping() { -#if QT_CONFIG(xkb) xcb_xkb_get_map_map_t map; memset(&rmod_masks, 0, sizeof(rmod_masks)); @@ -729,7 +707,6 @@ void QXcbKeyboard::updateVModToRModMapping() else if (vmod_masks.hyper == bit) rmod_masks.hyper = modmap; } -#endif } // Small helper: set modifier bit, if modifier position is valid diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h index e35c82ad24..0ee08aeff2 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.h +++ b/src/plugins/platforms/xcb/qxcbkeyboard.h @@ -43,14 +43,12 @@ #include "qxcbobject.h" #include -#if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include #undef explicit -#endif -#include #include +#include #include @@ -74,18 +72,14 @@ public: void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; - // when XKEYBOARD not present on the X server void updateXKBMods(); xkb_mod_mask_t xkbModMask(quint16 state); void updateXKBStateFromCore(quint16 state); -#if QT_CONFIG(xcb_xinput) void updateXKBStateFromXI(void *modInfo, void *groupInfo); -#endif -#if QT_CONFIG(xkb) - // when XKEYBOARD is present on the X server + int coreDeviceId() const { return core_device_id; } void updateXKBState(xcb_xkb_state_notify_event_t *state); -#endif + void handleStateChanges(xkb_state_component changedComponents); protected: @@ -97,10 +91,9 @@ protected: typedef QMap KeysymModifierMap; struct xkb_keymap *keymapFromCore(const KeysymModifierMap &keysymMods); - // when XKEYBOARD not present on the X server void updateModifiers(const KeysymModifierMap &keysymMods); KeysymModifierMap keysymsToModifiers(); - // when XKEYBOARD is present on the X server + void updateVModMapping(); void updateVModToRModMapping(); @@ -119,7 +112,6 @@ private: _mod_masks rmod_masks; - // when XKEYBOARD not present on the X server xcb_key_symbols_t *m_key_symbols = nullptr; struct _xkb_mods { xkb_mod_index_t shift; @@ -132,11 +124,9 @@ private: xkb_mod_index_t mod5; }; _xkb_mods xkb_mods; -#if QT_CONFIG(xkb) - // when XKEYBOARD is present on the X server + _mod_masks vmod_masks; int core_device_id; -#endif QXkbCommon::ScopedXKBState m_xkbState; QXkbCommon::ScopedXKBKeymap m_xkbKeymap; diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 97da420798..76d3545d35 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -67,9 +67,7 @@ #include #include #include -#if QT_CONFIG(xcb_xinput) #include -#endif #include #include @@ -492,14 +490,12 @@ void QXcbWindow::create() atom(QXcbAtom::_XEMBED_INFO), 32, 2, (void *)data); -#if QT_CONFIG(xcb_xinput) if (connection()->hasXInput2()) { if (connection()->xi2MouseEventsDisabled()) connection()->xi2SelectDeviceEventsCompatibility(m_window); else connection()->xi2SelectDeviceEvents(m_window); } -#endif setWindowState(window()->windowStates()); setWindowFlags(window()->flags()); @@ -1895,9 +1891,7 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in QPoint global(root_x, root_y); if (isWheel) { -#if QT_CONFIG(xcb_xinput) if (!connection()->isAtLeastXI21()) { -#endif QPoint angleDelta; if (detail == 4) angleDelta.setY(120); @@ -1910,9 +1904,7 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in if (modifiers & Qt::AltModifier) angleDelta = angleDelta.transposed(); QWindowSystemInterface::handleWheelEvent(window(), timestamp, local, global, QPoint(), angleDelta, modifiers); -#if QT_CONFIG(xcb_xinput) } -#endif return; } @@ -1948,13 +1940,8 @@ static inline bool doCheckUnGrabAncestor(QXcbConnection *conn) * not pressed, otherwise (e.g. on Alt+Tab) it can igonre important enter/leave events. */ if (conn) { - const bool mouseButtonsPressed = (conn->buttonState() != Qt::NoButton); -#if QT_CONFIG(xcb_xinput) return mouseButtonsPressed || (conn->hasXInput2() && !conn->xi2MouseEventsDisabled()); -#else - return mouseButtonsPressed; -#endif } return true; } @@ -1986,10 +1973,9 @@ void QXcbWindow::handleEnterNotifyEvent(int event_x, int event_y, int root_x, in if (ignoreEnterEvent(mode, detail, connection()) || connection()->mousePressWindow()) return; -#if QT_CONFIG(xcb_xinput) + // Updates scroll valuators, as user might have done some scrolling outside our X client. connection()->xi2UpdateScrollingDevices(); -#endif const QPoint local(event_x, event_y); QWindowSystemInterface::handleEnterEvent(window(), local, global); @@ -2064,7 +2050,6 @@ void QXcbWindow::handleMotionNotifyEvent(const xcb_motion_notify_event_t *event) event->time, QEvent::MouseMove); } -#if QT_CONFIG(xcb_xinput) static inline int fixed1616ToInt(xcb_input_fp1616_t val) { return int(qreal(val) / 0x10000); @@ -2165,7 +2150,6 @@ void QXcbWindow::handleXIEnterLeave(xcb_ge_event_t *event) break; } } -#endif QXcbWindow *QXcbWindow::toWindow() { return this; } @@ -2301,14 +2285,12 @@ bool QXcbWindow::setMouseGrabEnabled(bool grab) if (grab && !connection()->canGrab()) return false; -#if QT_CONFIG(xcb_xinput) if (connection()->hasXInput2() && !connection()->xi2MouseEventsDisabled()) { bool result = connection()->xi2SetMouseGrabEnabled(m_window, grab); if (grab && result) connection()->setMouseGrabber(this); return result; } -#endif if (!grab) { xcb_ungrab_pointer(xcb_connection(), XCB_TIME_CURRENT_TIME); @@ -2376,7 +2358,7 @@ bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner) return false; const QPoint globalPos = QHighDpi::toNativePixels(window()->mapToGlobal(pos), window()->screen()); -#if QT_CONFIG(xcb_xinput) + // ### FIXME QTBUG-53389 bool startedByTouch = connection()->startSystemMoveResizeForTouchBegin(m_window, globalPos, corner); if (startedByTouch) { @@ -2386,9 +2368,7 @@ bool QXcbWindow::startSystemMoveResize(const QPoint &pos, int corner) return false; } // KWin, Openbox, AwesomeWM have been tested to work with _NET_WM_MOVERESIZE. - } else -#endif - { // Started by mouse press. + } else { // Started by mouse press. if (connection()->isUnity()) return false; // _NET_WM_MOVERESIZE on this WM is bouncy (WM bug?). diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 5de5974ca7..13b37db028 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -137,10 +137,8 @@ public: void handleFocusInEvent(const xcb_focus_in_event_t *event) override; void handleFocusOutEvent(const xcb_focus_out_event_t *event) override; void handlePropertyNotifyEvent(const xcb_property_notify_event_t *event) override; -#if QT_CONFIG(xcb_xinput) void handleXIMouseEvent(xcb_ge_event_t *, Qt::MouseEventSource source = Qt::MouseEventNotSynthesized) override; void handleXIEnterLeave(xcb_ge_event_t *) override; -#endif QXcbWindow *toWindow() override; diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro deleted file mode 100644 index 078b275381..0000000000 --- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro +++ /dev/null @@ -1,80 +0,0 @@ -# -# Statically compile in code for -# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image, -# libxcb-keysyms, libxcb-icccm, libxcb-renderutil, libxcb-xkb, -# libxcb-xinerama, libxcb-xinput -# -CONFIG += static - -XCB_DIR = $$QT_SOURCE_TREE/src/3rdparty/xcb - -MODULE_INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude -INCLUDEPATH += $$XCB_DIR/include/xcb - -QMAKE_USE += xcb/nolink - -# ignore compiler warnings in 3rdparty code -QMAKE_CFLAGS_STATIC_LIB+=-w - -# -# libxcb -# -LIBXCB_DIR = $$XCB_DIR/libxcb - -SOURCES += \ - $$LIBXCB_DIR/xfixes.c \ - $$LIBXCB_DIR/randr.c \ - $$LIBXCB_DIR/shm.c \ - $$LIBXCB_DIR/sync.c \ - $$LIBXCB_DIR/render.c \ - $$LIBXCB_DIR/shape.c \ - $$LIBXCB_DIR/xkb.c \ - $$LIBXCB_DIR/xinerama.c \ - $$LIBXCB_DIR/xinput.c - -# -# xcb-util -# -XCB_UTIL_DIR = $$XCB_DIR/xcb-util - - -SOURCES += \ - $$XCB_UTIL_DIR/xcb_aux.c \ - $$XCB_UTIL_DIR/atoms.c \ - $$XCB_UTIL_DIR/event.c - -# -# xcb-util-image -# -XCB_IMAGE_DIR = $$XCB_DIR/xcb-util-image - -SOURCES += $$XCB_IMAGE_DIR/xcb_image.c - -# -# xcb-util-keysyms -# -XCB_KEYSYMS_DIR = $$XCB_DIR/xcb-util-keysyms - -SOURCES += $$XCB_KEYSYMS_DIR/keysyms.c - -# -# xcb-util-renderutil -# - -XCB_RENDERUTIL_DIR = $$XCB_DIR/xcb-util-renderutil - -SOURCES += $$XCB_RENDERUTIL_DIR/util.c - -# -# xcb-util-wm -# -XCB_WM_DIR = $$XCB_DIR/xcb-util-wm - -SOURCES += \ - $$XCB_WM_DIR/icccm.c - -OTHER_FILES = $$XCB_DIR/README - -TR_EXCLUDE += $$XCB_DIR/* - -load(qt_helper_lib) diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro index 0d27645a60..1c43c5ca04 100644 --- a/src/plugins/platforms/xcb/xcb.pro +++ b/src/plugins/platforms/xcb/xcb.pro @@ -2,8 +2,6 @@ TEMPLATE = subdirs CONFIG += ordered QT_FOR_CONFIG += gui-private -!qtConfig(system-xcb): SUBDIRS += xcb-static - SUBDIRS += xcb_qpa_lib.pro SUBDIRS += xcb-plugin.pro SUBDIRS += gl_integrations diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index 34c671c8c7..a5d05faa9c 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -35,6 +35,7 @@ SOURCES = \ qxcbeventdispatcher.cpp \ qxcbconnection_basic.cpp \ qxcbconnection_screens.cpp \ + qxcbconnection_xi2.cpp \ qxcbatom.cpp HEADERS = \ @@ -71,10 +72,6 @@ qtConfig(xcb-xlib) { QMAKE_USE += xcb_xlib } -qtConfig(xcb-xinput) { - SOURCES += qxcbconnection_xi2.cpp -} - qtConfig(xcb-sm) { QMAKE_USE += x11sm SOURCES += qxcbsessionmanager.cpp @@ -94,20 +91,19 @@ qtConfig(vulkan) { qxcbvulkanwindow.h } -!qtConfig(system-xcb) { - QMAKE_USE += xcb-static -} else { - qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput - QMAKE_USE += \ - xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \ - xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama -} -QMAKE_USE += xcb +QMAKE_USE += \ + xcb xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \ + xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb_xkb xkbcommon xkbcommon_x11 -QMAKE_USE += xkbcommon -qtConfig(xkb) { - QMAKE_USE += xkbcommon_x11 - qtConfig(system-xcb): QMAKE_USE += xcb_xkb +qtConfig(system-xcb-xinput) { + QMAKE_USE += xcb_xinput +} else { + # Use bundled xcb-xinput sources. + XCB_DIR = $$QT_SOURCE_TREE/src/3rdparty/xcb + INCLUDEPATH += $$XCB_DIR/include/ + SOURCES += $$XCB_DIR/libxcb/xinput.c + # Ignore compiler warnings in 3rdparty C code. + QMAKE_CFLAGS+=-w } qtConfig(dlopen): QMAKE_USE += libdl -- cgit v1.2.3