summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-11-22 15:45:36 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2016-11-23 12:41:19 +0000
commit389b4ec28b6bb402d3575ff9c648ef878257ea84 (patch)
tree2350f73c2d973b87e791f62bd100f28f04fbbfa6
parentd8857f21ac2640215177b9cb7bb681b74bc66068 (diff)
Windows QPA: Do not send key events for mouse-synthesized app commands
Sending key events in addition causes applications to respond twice to for example the back / forward extra mouse buttons. Suppress the keypress by checking on the device. This is in line with the other platforms, which do not send keypresses either. Native event filters will still be able to listen for WM_APPCOMMAND. Task-number: QTBUG-48117 Task-number: QTBUG-57198 Change-Id: I219e17244087663f06ab2c5a8cf4b880c3655700 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r--src/plugins/platforms/windows/qwindowskeymapper.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp
index 60361e436d..a52ae7c2a9 100644
--- a/src/plugins/platforms/windows/qwindowskeymapper.cpp
+++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp
@@ -861,6 +861,9 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd,
bool QWindowsKeyMapper::translateMultimediaKeyEventInternal(QWindow *window, const MSG &msg)
{
#if defined(WM_APPCOMMAND)
+ // QTBUG-57198, do not send mouse-synthesized commands as key events in addition
+ if (GET_DEVICE_LPARAM(msg.lParam) == FAPPCOMMAND_MOUSE)
+ return false;
const int cmd = GET_APPCOMMAND_LPARAM(msg.lParam);
const int dwKeys = GET_KEYSTATE_LPARAM(msg.lParam);
int state = 0;