diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2019-02-19 10:09:19 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2019-08-27 01:06:40 +0200 |
commit | 60588e1a5dd9b10803e078c741271cbe5713a51b (patch) | |
tree | ea23ed6e0700aadcba7c323261e331dadd8af132 /src/plugins/platforms/xcb/qxcbkeyboard.cpp | |
parent | 5bb178c479a247720fbc3fbb7f06a32b725193ac (diff) |
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 <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
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 <private/qguiapplication_p.h> -#if QT_CONFIG(xkb) -#include <xkbcommon/xkbcommon-x11.h> -#endif - -#if QT_CONFIG(xcb_xinput) #include <xcb/xinput.h> -#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<int> 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 |