diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-03-19 15:09:19 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-04-20 21:37:27 +0000 |
commit | a0a22037cdacbf51a2db560ff902a5a341561b15 (patch) | |
tree | ba8be2c7446257a02b282afab98b44b0f6799ccf /src/plugins/platforms/windows/qwindowskeymapper.cpp | |
parent | ab6cc41968ec6eedd16e4305cf38ef937b2a8d56 (diff) |
Windows QPA: Fix duplicate/missing native events
Add utility functions to QWindowsContext input messages sent to
native event filters (event dispatcher and window system interface).
Do not send input and similar events to the event dispatcher since
QEventDispatcherWin32::processEvents() also sends them.
Note though that QEventDispatcherWin32 does not receive all windows
messages.
In QWindowsKeyMapper, send the WM_CHAR/WM_IMECHAR events from
where the messages are removed.
Task-number: QTBUG-67095
Change-Id: I5f61294fcb3aee7e0eacd840a2010d128cd02a5d
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowskeymapper.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowskeymapper.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index af62936a18..6189fe32f1 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -830,7 +830,7 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd, if (PeekMessage(&peekedMsg, hwnd, 0, 0, PM_NOREMOVE) && peekedMsg.message == WM_DEADCHAR) return true; - return translateKeyEventInternal(widget, msg, false); + return translateKeyEventInternal(widget, msg, false, result); } bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, const MSG &msg) @@ -862,7 +862,7 @@ bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, con #endif } -bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &msg, bool /* grab */) +bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &msg, bool /* grab */, LRESULT *lResult) { const UINT msgType = msg.message; @@ -1056,6 +1056,10 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms QChar uch; if (PeekMessage(&wm_char, 0, charType, charType, PM_REMOVE)) { + if (QWindowsContext::filterNativeEvent(&wm_char, lResult)) + return true; + if (receiver && QWindowsContext::filterNativeEvent(receiver, &wm_char, lResult)) + return true; // Found a ?_CHAR uch = QChar(ushort(wm_char.wParam)); if (uch.isHighSurrogate()) { |