summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-01-26 13:28:37 +0100
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2016-01-28 16:30:26 +0000
commitee9621b9dc6cab96df627aa7b926e6256ea2102a (patch)
treea8c739bb53d53e68c4cd44cd6c5dd1e471d8b508 /src/gui/kernel/qguiapplication.cpp
parent33bdb93ae1b1a19eb46d924a31a58237850fbfa4 (diff)
Move shortcut handling back into QGuiApplication
c7e5e1d9e01849 assumed shortcut handling could be done at the QPA level, but this fails on async platforms where there are e.g activation events in the QPA queue and we then try to handle the shortcut synchronously. This commit restores the handling to QtGui for non-OS X platforms, and we should fix OS X by adding callbacks through the IME for the special case of OS X. Task-number: QTBUG-50467 Change-Id: I7460184cc60d0319f07771eec487325a17d7e7e7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index b8c7bbba0a..a19abccb37 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1960,6 +1960,15 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
window = QGuiApplication::focusWindow();
}
+#if !defined(Q_OS_OSX)
+ // FIXME: Include OS X in this code path by passing the key event through
+ // QPlatformInputContext::filterEvent().
+ if (e->keyType == QEvent::KeyPress && window) {
+ QWindowSystemInterface::handleShortcutEvent(window, e->timestamp, e->key, e->modifiers,
+ e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount);
+ }
+#endif
+
QKeyEvent ev(e->keyType, e->key, e->modifiers,
e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
e->unicode, e->repeat, e->repeatCount);