diff options
author | Joona Petrell <joona.t.petrell@nokia.com> | 2011-09-08 17:22:55 +0300 |
---|---|---|
committer | Lars Knoll <lars.knoll@nokia.com> | 2011-09-08 21:40:40 +0200 |
commit | 8be11227100498d7098eb7f39bbbe1e7ac6b01cf (patch) | |
tree | 27a7b596fd69e014a8e4736fb9fd9d037603d643 /src/plugins/platforms/xcb/qxcbkeyboard.cpp | |
parent | 7ad91ad9ca89d868d59a1fcff85349cc9786f99a (diff) |
Add plugin mechanism to load platform input contexts
Change-Id: I6e74fd395325445420efce4adf13e89abe8177ee
Reviewed-on: http://codereview.qt-project.org/4482
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 6f37c078a1..18080dbb0c 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -50,7 +50,7 @@ #include <stdio.h> #if defined(XCB_USE_IBUS) -#include "QtPlatformSupport/qibusplatforminputcontext.h" +#include <qplatforminputcontext_qpa.h> #endif #ifndef XK_ISO_Left_Tab @@ -1029,9 +1029,20 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod QByteArray chars; xcb_keysym_t sym = lookupString(window, state, code, type, &chars); - QIBusPlatformInputContext *ic = static_cast<QIBusPlatformInputContext *>(QGuiApplicationPrivate::platformIntegration()->inputContext()); - if (ic && ic->x11FilterEvent(sym, code, state, type == QEvent::KeyPress)) - return; + +#if defined(XCB_USE_IBUS) + if (QObject* inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext()) { + QVariant value; + QMetaObject::invokeMethod(inputContext, "x11FilterEvent", Qt::DirectConnection, + Q_RETURN_ARG(QVariant, value), + Q_ARG(uint, sym), + Q_ARG(uint, code), + Q_ARG(uint, state), + Q_ARG(bool, type == QEvent::KeyPress)); + if (value.toBool()) + return; + } +#endif Qt::KeyboardModifiers modifiers; int qtcode = 0; |