~feng-kylin/unity8/OpenUrlInIndicator

« back to all changes in this revision

Viewing changes to qml/Stages/ApplicationWindow.qml

  • 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:
61
61
        // Remove this when possible
62
62
        property bool surfaceInitialized: false
63
63
 
64
 
        function forceSurfaceActiveFocusIfReady() {
65
 
            if (sessionContainer.surface !== null &&
66
 
                    sessionContainer.surface.focus &&
67
 
                    sessionContainer.surface.parent === sessionContainer.surfaceContainer &&
68
 
                    sessionContainer.surface.enabled) {
69
 
                sessionContainer.surface.forceActiveFocus();
70
 
            }
71
 
        }
72
64
    }
73
65
 
74
66
    Timer {
77
69
        onTriggered: { if (sessionContainer.surface) {d.surfaceInitialized = true;} }
78
70
    }
79
71
 
80
 
    Connections {
81
 
        target: sessionContainer.surface
82
 
        // FIXME: I would rather not need to do this, but currently it doesn't get
83
 
        // active focus without it and I don't know why.
84
 
        onFocusChanged: d.forceSurfaceActiveFocusIfReady();
85
 
        onParentChanged: d.forceSurfaceActiveFocusIfReady();
86
 
        onEnabledChanged: d.forceSurfaceActiveFocusIfReady();
87
 
    }
88
 
 
89
72
    Image {
90
73
        id: screenshotImage
91
74
        objectName: "screenshotImage"