diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-04-10 12:48:01 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-04-10 15:31:45 +0200 |
commit | 143c4d3e13a430b951f4f4f8c28db14303f80605 (patch) | |
tree | 2b89637b93fc7d81c674106008566010f986d67c /src/plugins/platforms/xcb/qxcbkeyboard.cpp | |
parent | a7ed81b557d593a8ddb43b71bf4bbf3b44ead070 (diff) | |
parent | e5337ad1b1fb02873ce7b5ca8db45f6fd8063352 (diff) |
Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
configure
src/widgets/styles/qwindowsxpstyle.cpp
tests/auto/gui/kernel/qwindow/qwindow.pro
tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index c5e124ab45..ef98f82e97 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -1073,14 +1073,6 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod int count = chars.count(); QString string = translateKeySym(sym, state, qtcode, modifiers, chars, count); - if (inputContext) { - QKeyEvent event(type, qtcode, modifiers, string); - event.setTimestamp(time); - bool retval = inputContext->filterEvent(&event); - if (retval) - return; - } - bool isAutoRepeat = false; if (type == QEvent::KeyPress) { @@ -1099,13 +1091,28 @@ void QXcbKeyboard::handleKeyEvent(QWindow *window, QEvent::Type type, xcb_keycod m_autorepeat_code = isAutoRepeat ? code : 0; } - QWindowSystemInterface::handleExtendedKeyEvent(window, time, type, qtcode, modifiers, - code, 0, state, string.left(count), isAutoRepeat); + bool filtered = false; + if (inputContext) { + QKeyEvent event(type, qtcode, modifiers, string, isAutoRepeat); + event.setTimestamp(time); + filtered = inputContext->filterEvent(&event); + } + + if (!filtered) + QWindowSystemInterface::handleExtendedKeyEvent(window, time, type, qtcode, modifiers, + code, 0, state, string.left(count), isAutoRepeat); if (isAutoRepeat && type == QEvent::KeyRelease) { // since we removed it from the event queue using checkEvent we need to send the key press here - QWindowSystemInterface::handleExtendedKeyEvent(window, time, QEvent::KeyPress, qtcode, modifiers, - code, 0, state, string.left(count), isAutoRepeat); + filtered = false; + if (inputContext) { + QKeyEvent event(QEvent::KeyPress, qtcode, modifiers, string, isAutoRepeat); + event.setTimestamp(time); + filtered = inputContext->filterEvent(&event); + } + if (!filtered) + QWindowSystemInterface::handleExtendedKeyEvent(window, time, QEvent::KeyPress, qtcode, modifiers, + code, 0, state, string.left(count), isAutoRepeat); } } |