~feng-kylin/unity8/OpenUrlInIndicator

« back to all changes in this revision

Viewing changes to tests/uqmlscene/main.cpp

  • Committer: Daniel d'Andrada
  • Date: 2014-10-01 13:20:32 UTC
  • mto: (1354.2.4 unity8-update-quicklist)
  • mto: This revision was merged to the branch mainline in revision 1364.
  • Revision ID: daniel.dandrada@canonical.com-20141001132032-t4ag3a1or9k2fwz8
Add touch ownership logic on top of qt input handling

It does mainly 3 things:
- Adds TouchRegistry.
- Adds TouchGate
- Modifies DirectionalDragArea so that it uses TouchRegistry and only grabs a touch once it has recognized a gesture done by it.

TouchRegistry was put into a library as both unity8 and Ubuntu.Gestures plugin need to use it.

The next step is to have surfaces participating in the touch ownership negotiation. But for now they're put behind TouchGates so that they only receive thouches whose ownership has already been settled.

The most noticeable improvement of this patch is that taps near screen edges will now reach applications.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
#include <MouseTouchAdaptor.h>
67
67
 
 
68
// UbuntuGestures lib
 
69
#include <TouchRegistry.h>
 
70
 
68
71
#ifdef QML_RUNTIME_TESTING
69
72
class RenderStatistics
70
73
{
496
499
                QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel);
497
500
                if (contentItem) {
498
501
                    qxView = new QQuickView(&engine, nullptr);
 
502
                    if (TouchRegistry::instance() == nullptr) {
 
503
                        new TouchRegistry(qxView);
 
504
                    } else {
 
505
                        TouchRegistry::instance()->setParent(qxView);
 
506
                    }
 
507
                    qxView->installEventFilter(TouchRegistry::instance());
499
508
                    window = qxView;
500
509
                    // Set window default properties; the qml can still override them
501
510
                    QString oname = contentItem->objectName();