summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-01-13 17:37:49 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2012-01-13 17:28:40 +0100
commit27f9b7e3d26df8a33b86161d91ddeb8f80ffa4e3 (patch)
tree6ad54bf41935598657c27e099ad79fe05ceebfd6 /examples
parent2fcfaf58e68e1bad67057bae39e194884a445f4b (diff)
Introduce a touch protocol extension.
Using this opt-in protocol extension all data from QTouchEvent will properly be delivered to the clients. By default compositors will still use the standard and limited protocol for touch events to remain compatible with non-Qt clients. However by calling enableTouchExtension() in the compositor, touch events will be sent through the new protocol and thus Qt clients will receive proper QTouchEvents. Non-Qt clients will get no touch data in this mode. The contents of the rawScreenPositions() list are not yet delivered as the size implications remain to be checked. Change-Id: I981b9c4d44ea808a95b770bf948320abd47fc036 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qwindow-compositor/main.cpp4
-rw-r--r--examples/qwindow-compositor/qwindowcompositor.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/examples/qwindow-compositor/main.cpp b/examples/qwindow-compositor/main.cpp
index 3a640140a..fdacaf56c 100644
--- a/examples/qwindow-compositor/main.cpp
+++ b/examples/qwindow-compositor/main.cpp
@@ -47,6 +47,10 @@
int main(int argc, char *argv[])
{
+ // Enable the following to have touch events generated from mouse events.
+ // Very handy for testing touch event delivery without a real touch device.
+ // QGuiApplication::setAttribute(Qt::AA_SynthesizeTouchForUnhandledMouseEvents, true);
+
QGuiApplication app(argc, argv);
QScreen *screen = QGuiApplication::primaryScreen();
QRect screenGeometry = screen->availableGeometry();
diff --git a/examples/qwindow-compositor/qwindowcompositor.cpp b/examples/qwindow-compositor/qwindowcompositor.cpp
index 310ff19ab..1aa4f102e 100644
--- a/examples/qwindow-compositor/qwindowcompositor.cpp
+++ b/examples/qwindow-compositor/qwindowcompositor.cpp
@@ -14,6 +14,10 @@ QWindowCompositor::QWindowCompositor(QOpenGLWindow *window)
, m_draggingWindow(0)
, m_dragKeyIsPressed(false)
{
+ // Enable the following to have all QTouchEvent-specific data delivered
+ // using a custom protocol extension.
+ // enableTouchExtension();
+
enableSubSurfaceExtension();
m_window->makeCurrent();