summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2012-04-03 17:01:12 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-03 23:04:43 +0200
commit7adef58fd9607037bb3e63c0460350dd324af8e8 (patch)
tree4c733b8cc534c637571d7f1dfb0655d015771aed /src
parenteb04862920eb6302f242e6a8fb75c58968311658 (diff)
Pass autorepeat info to input context key filtering with XCB
Change-Id: Ifbb658dde6689543f48ed8fb82109ea07bcf8bd7 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp31
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);
}
}