summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2013-10-10 10:47:51 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-14 12:08:00 +0200
commit99b20ce0b9316dae0668d71b718bd23eaddbca09 (patch)
tree8c4cbf5a22fe3483ae994e46865eddff30ffaa94 /src/gui
parentd004af667d76d43a346dab502c5ccedeafecc29d (diff)
Update QPA cursor only for non-synthetic mouse events
Unhandled touch events cause QGuiApplication to generate synthetic mouse event by default. This is good but on embedded systems, where there is no windowing system and thus the platform cursor implementation relies solely on QGuiApplication pushing position updates via pointerEvent(), this causes odd behavior when there is both a touchscreen and a mouse present. The patch changes QGuiApplication to call pointerEvent() only when the event is not synthetic. This will prevent the mouse cursor from jumping to the position of the touch when using the touchscreen. It is needed also because moving the mouse later would make the cursor jump back to its previous, "real" mouse position anyhow which is extremely annoying. This is now avoided. Change-Id: I807a173bff7e2afa7eb66961a7ecc88b2c0430ca Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qguiapplication.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 542b95f58f..1e3ea3092f 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1566,9 +1566,11 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers);
ev.setTimestamp(e->timestamp);
#ifndef QT_NO_CURSOR
- if (const QScreen *screen = window->screen())
- if (QPlatformCursor *cursor = screen->handle()->cursor())
- cursor->pointerEvent(ev);
+ if (!e->synthetic) {
+ if (const QScreen *screen = window->screen())
+ if (QPlatformCursor *cursor = screen->handle()->cursor())
+ cursor->pointerEvent(ev);
+ }
#endif
if (window->d_func()->blockedByModalWindow) {