on xenial help sign in
Clean up things
commite6096a424dcfc319645462a4774b4eb3d758654c authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 1 Oct 2014, 14:57 (12 years ago) parentdd7391c
2 files changed+5−2
qml/Stages/ApplicationWindow.qml−1 qml/Stages/SurfaceContainer.qml+5−1
qml/Stages/ApplicationWindow.qml−1
@@ -115,7 +115,6 @@ Item {
115115 onSurfaceChanged: {
116116 if (sessionContainer.surface) {
117117 surfaceInitTimer.start();
118− d.forceSurfaceActiveFocusIfReady();
119118 } else {
120119 d.surfaceInitialized = false;
121120 }
qml/Stages/SurfaceContainer.qml+5−1
@@ -29,6 +29,7 @@ Item {
2929 onSurfaceChanged: {
3030 if (surface) {
3131 surface.parent = root;
32+ d.forceSurfaceActiveFocusIfReady();
3233 } else {
3334 hadSurface = true;
3435 }
@@ -42,7 +43,7 @@ Item {
4243 TouchGate {
4344 targetItem: surface
4445 anchors.fill: root
45− enabled: surface.enabled
46+ enabled: root.surface ? root.surface.enabled : false
4647 z: 2
4748 }
4849
@@ -50,6 +51,9 @@ Item {
5051 target: root.surface
5152 // FIXME: I would rather not need to do this, but currently it doesn't get
5253 // active focus without it and I don't know why.
54+ // Possibly because if an item get focus=true before it has a parent, once
55+ // it gets a parent QQuickWindow won't check its focus and update its activeFocus
56+ // accordingly. Unlike when you focus=true after the item already has a parent.
5357 onFocusChanged: d.forceSurfaceActiveFocusIfReady();
5458 onParentChanged: d.forceSurfaceActiveFocusIfReady();
5559 onEnabledChanged: d.forceSurfaceActiveFocusIfReady();