summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication.cpp
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2014-09-12 15:41:44 +0400
committerAlexander Volkov <a.volkov@rusbitech.ru>2014-09-16 14:02:32 +0200
commita9d029974ea27417f9c75a6cd6d4f1d4434635f0 (patch)
treeafda7e8a72a67954d03f8f8079f805e1ea2a351e /src/gui/kernel/qguiapplication.cpp
parent05605b774eced0e8ddc3fa8c30ec618cad5412cd (diff)
Change the state of only the left mouse button when sending fake mouse events
Mouse events synthesized from touch events affect only the left mouse button. So preserve the state of other buttons. Change-Id: I628d41089db39f0c983aa95f311a842111b8c39c Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r--src/gui/kernel/qguiapplication.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 19f15d88bf..7dcadf74a8 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -2272,7 +2272,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
e->timestamp,
synthIt->pos,
synthIt->screenPos,
- Qt::NoButton,
+ buttons & ~Qt::LeftButton,
e->modifiers,
Qt::MouseEventSynthesizedByQt);
fake.synthetic = true;
@@ -2474,7 +2474,8 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
QWindowSystemInterfacePrivate::MouseEvent fake(w, e->timestamp,
touchPoint.pos(),
touchPoint.screenPos(),
- b, e->modifiers);
+ b | (buttons & ~Qt::LeftButton),
+ e->modifiers);
fake.synthetic = true;
processMouseEvent(&fake);
break;