From a9d029974ea27417f9c75a6cd6d4f1d4434635f0 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Fri, 12 Sep 2014 15:41:44 +0400 Subject: 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 --- src/gui/kernel/qguiapplication.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qguiapplication.cpp') 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; -- cgit v1.2.3