@@ -28,7 +28,12 @@ ColumnLayout {
29 property var screenshotIds: [ "gallery", "map", "facebook", "camera", "browser", "music", "twitter"]
29 property var screenshotIds: [ "gallery", "map", "facebook", "camera", "browser", "music", "twitter"]
32+ if (!session) surfaceCheckbox.checked = false;
32 Layout.fillWidth: true
37 Layout.fillWidth: true
33 visible: repeater.count
38 visible: repeater.count
34 spacing: units.gu(1)
39 spacing: units.gu(1)
@@ -42,8 +47,8 @@ ColumnLayout {
45− left: parent.left
50+ left: column.left
46− right: parent.right
51+ right: column.right
47 leftMargin: units.gu(1)
52 leftMargin: units.gu(1)
48 rightMargin: units.gu(1)
53 rightMargin: units.gu(1)
@@ -73,23 +78,53 @@ ColumnLayout {
76− Item {
81+ ColumnLayout {
77 Layout.fillWidth: true
82 Layout.fillWidth: true
78− Layout.preferredHeight: buttonLayout.height + units.gu(1)
83+ spacing: units.gu(1)
80 RowLayout {
85 RowLayout {
81− id: buttonLayout
86+ Layout.fillWidth: true
83− top: parent.top; topMargin: units.gu(0.5)
88+ CheckBox {
84− left: parent.left; leftMargin: units.gu(1)
89+ id: surfaceCheckbox;
91+ enabled: root.session
94+ root.session.createSurface();
95+ } else if (root.session.surface) {
96+ root.session.surface.removed();
101+ target: root.session ? root.session : null
103+ surfaceCheckbox.checked = root.session.surface !== null
110+ anchors.verticalCenter: parent.verticalCenter
88 enabled: root.session
118 enabled: root.session
89 text: removable ? "Remove" : "Release"
119 text: removable ? "Remove" : "Release"
90 onClicked: {
120 onClicked: {
91− if (removable) root.session.removed();
121+ if (removable) {
122+ // release the surface first. simulates mir app closing
123+ if (root.session.surface) root.session.surface.removed();
124+ root.session.removed();
92− else root.session.release();
126+ root.session.release();
@@ -97,8 +132,7 @@ ColumnLayout {
97 enabled: root.session !== null
132 enabled: root.session !== null
98 text: "Add Child"
133 text: "Add Child"
99 onClicked: {
134 onClicked: {
100− var screenshot = Math.round(Math.random() * screenshotIds.length);
135+ var screenshot = Math.round(Math.random()*100 % (screenshotIds.length-1));
101− console.log(screenshot)
102 var session = ApplicationTest.addChildSession(root.session, root.screenshotIds[screenshot]);
136 var session = ApplicationTest.addChildSession(root.session, root.screenshotIds[screenshot]);