diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2013-03-25 14:44:48 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-07 22:43:14 +0200 |
commit | 05351b0cde3e80d2d0ae3a838e802ff6086e4b59 (patch) | |
tree | dbcbb18247aafe9485e7ccbbbc903c858bb1c75d /src/plugins/platforms/xcb/qxcbconnection.h | |
parent | 9c1d62cc95ed2579fa25d83901c7a1aa315aa2d3 (diff) |
Utilize libxkbcommon API for the keyboard backend on X11
libxkbcommon is a keymap compiler [1] which utilizes xkb
keyboard configuration database [2].
xkbcommon simplifies keyboard state handling by providing xkb_state
object which holds the current state of all modifiers, groups, LEDs,
etc, relating to the provided keymap.
Detecting modifier mapping should become simpler once it gets supported
in libxkbcommon. Also with xinput2 we could get rid of the XkbStateNotify
events, because xinput2 key press/release already include all the mod/group
info.
[1] http://xkbcommon.org/
[2] http://www.freedesktop.org/wiki/Software/XKeyboardConfig
This patch:
- Removes a dependency to -lxcb-keysyms
- Removes a dependency to XLib call - XLookupString
- Enables required functionality to fix QTBUG-27681
Task-number: QTBUG-27680
Change-Id: I10e10f873821ee02f6df72238e215a541150f38f
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 1d6f09a2bc..3aa13a8b3a 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -53,6 +53,14 @@ #include <QVarLengthArray> #include <qpa/qwindowsysteminterface.h> +// This is needed to make Qt compile together with XKB. xkb.h is using a variable +// which is called 'explicit', this is a reserved keyword in c++ */ +#ifndef QT_NO_XKB +#define explicit dont_use_cxx_explicit +#include <xcb/xkb.h> +#undef explicit +#endif + #ifndef QT_NO_TABLETEVENT #include <QTabletEvent> #endif @@ -355,7 +363,7 @@ public: #endif QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); } - + xcb_window_t rootWindow(); #ifdef XCB_USE_XLIB void *xlib_display() const { return m_xlib_display; } #endif @@ -402,6 +410,7 @@ public: bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } + bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } @@ -430,6 +439,7 @@ private: void initializeXRender(); void initializeXRandr(); void initializeXShape(); + void initializeXKB(); #ifdef XCB_USE_XINPUT2_MAEMO void initializeXInput2Maemo(); void finalizeXInput2Maemo(); @@ -539,12 +549,14 @@ private: uint32_t xfixes_first_event; uint32_t xrandr_first_event; + uint32_t xkb_first_event; bool has_glx_extension; bool has_shape_extension; bool has_randr_extension; bool has_input_shape; bool has_touch_without_mouse_emulation; + bool has_xkb; Qt::MouseButtons m_buttons; |