From 3edcd9420e3ad661cad89420e18dbb70e7ad450b Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Mon, 29 May 2017 12:07:13 +0200 Subject: Support legacy X11 keymaps Not all X server vendors support the XKB protocol. Furthermore, while X.org seems to use keycodes that match the usual keyboard scancodes, other vendors may not do so. This means that using an XKB keymap suitable for an X.org server results in garbled input with servers for other vendors. Both of these issues are addressed by using the core keycode information as a fallback. [ChangeLog][X11] Fall back to X11 core keycode information if an XKB keymap could not be determined through the connection. Task-number: QTBUG-44938 Change-Id: I64568aa31113d5a3fd90f70c63320a497db21477 Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbkeyboard.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.h') diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h index 1e3e97d1ec..7ee8e9e90d 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.h +++ b/src/plugins/platforms/xcb/qxcbkeyboard.h @@ -94,6 +94,9 @@ protected: void readXKBConfig(); void clearXKBConfig(); +#if QT_CONFIG(xcb_xlib) + struct xkb_keymap *keymapFromCore(); +#endif // when XKEYBOARD not present on the X server void updateModifiers(); typedef QMap KeysymModifierMap; @@ -109,6 +112,7 @@ private: void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state); bool m_config = false; + bool m_keymap_is_core = false; xcb_keycode_t m_autorepeat_code = 0; struct xkb_context *xkb_context = nullptr; -- cgit v1.2.3