From 8be11227100498d7098eb7f39bbbe1e7ac6b01cf Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 8 Sep 2011 17:22:55 +0300 Subject: Add plugin mechanism to load platform input contexts Change-Id: I6e74fd395325445420efce4adf13e89abe8177ee Reviewed-on: http://codereview.qt-project.org/4482 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.cpp') 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 #if defined(XCB_USE_IBUS) -#include "QtPlatformSupport/qibusplatforminputcontext.h" +#include #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(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; -- cgit v1.2.3