on xenial help sign in
Clean up things
e6096a4Daniel d'Andrada
qml/Stages/ApplicationWindow.qml−1
@@ -115,7 +115,6 @@ Item {
115 onSurfaceChanged: {
115 onSurfaceChanged: {
116 if (sessionContainer.surface) {
116 if (sessionContainer.surface) {
117 surfaceInitTimer.start();
117 surfaceInitTimer.start();
118− d.forceSurfaceActiveFocusIfReady();
119 } else {
118 } else {
120 d.surfaceInitialized = false;
119 d.surfaceInitialized = false;
121 }
120 }
qml/Stages/SurfaceContainer.qml+5−1
@@ -29,6 +29,7 @@ Item {
29 onSurfaceChanged: {
29 onSurfaceChanged: {
30 if (surface) {
30 if (surface) {
31 surface.parent = root;
31 surface.parent = root;
32+ d.forceSurfaceActiveFocusIfReady();
32 } else {
33 } else {
33 hadSurface = true;
34 hadSurface = true;
34 }
35 }
@@ -42,7 +43,7 @@ Item {
42 TouchGate {
43 TouchGate {
43 targetItem: surface
44 targetItem: surface
44 anchors.fill: root
45 anchors.fill: root
45− enabled: surface.enabled
46+ enabled: root.surface ? root.surface.enabled : false
46 z: 2
47 z: 2
47 }
48 }
48
49
@@ -50,6 +51,9 @@ Item {
50 target: root.surface
51 target: root.surface
51 // FIXME: I would rather not need to do this, but currently it doesn't get
52 // FIXME: I would rather not need to do this, but currently it doesn't get
52 // active focus without it and I don't know why.
53 // 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.
53 onFocusChanged: d.forceSurfaceActiveFocusIfReady();
57 onFocusChanged: d.forceSurfaceActiveFocusIfReady();
54 onParentChanged: d.forceSurfaceActiveFocusIfReady();
58 onParentChanged: d.forceSurfaceActiveFocusIfReady();
55 onEnabledChanged: d.forceSurfaceActiveFocusIfReady();
59 onEnabledChanged: d.forceSurfaceActiveFocusIfReady();