summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-02-02 14:33:18 +0100
committerGatis Paeglis <gatis.paeglis@qt.io>2018-02-25 09:50:07 +0000
commit6c88dc0c16545a06d57c7d3ee0b56aba14ddaefc (patch)
treefd7aad52da58d3c28c47aae9ab604fdd4d2a2131 /src/plugins/platforms/xcb
parent7c01c759aef565162e4d5f04527a8946857c56ff (diff)
xcb: remove X11 deps from QXcbKeyboard::checkForLatinLayout/lookupLatinKeysym()
This will allow us to reuse these functions on systems that do not rely on X11, but use libxkbcommon for handling keyboard input. Task-number: QTBUG-65503 Change-Id: I78034238771be96fbb38e8187801fefbee1a5fed Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 7428e419db..f24d2f6f6d 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -880,8 +880,8 @@ static bool isLatin(xkb_keysym_t sym)
void QXcbKeyboard::checkForLatinLayout() const
{
const xkb_layout_index_t layoutCount = xkb_keymap_num_layouts(m_xkbKeymap.get());
- const xcb_keycode_t minKeycode = connection()->setup()->min_keycode;
- const xcb_keycode_t maxKeycode = connection()->setup()->max_keycode;
+ const xcb_keycode_t minKeycode = xkb_keymap_min_keycode(m_xkbKeymap.get());
+ const xcb_keycode_t maxKeycode = xkb_keymap_max_keycode(m_xkbKeymap.get());
ScopedXKBState state(xkb_state_new(m_xkbKeymap.get()));
for (xkb_layout_index_t layout = 0; layout < layoutCount; ++layout) {
@@ -940,8 +940,8 @@ xkb_keysym_t QXcbKeyboard::lookupLatinKeysym(xkb_keycode_t keycode) const
// then the obtained key is not unique. This prevents ctrl+<physical q key> from generating a ctrl+q
// shortcut in the above described setup. We don't want ctrl+<physical x key> and ctrl+<physical q key> to
// generate the same shortcut event in this case.
- const xcb_keycode_t minKeycode = connection()->setup()->min_keycode;
- const xcb_keycode_t maxKeycode = connection()->setup()->max_keycode;
+ const xcb_keycode_t minKeycode = xkb_keymap_min_keycode(m_xkbKeymap.get());
+ const xcb_keycode_t maxKeycode = xkb_keymap_max_keycode(m_xkbKeymap.get());
ScopedXKBState state(xkb_state_new(m_xkbKeymap.get()));
for (xkb_layout_index_t prevLayout = 0; prevLayout < layout; ++prevLayout) {
xkb_state_update_mask(state.get(), 0, latchedMods, lockedMods, 0, 0, prevLayout);