@@ -18,8 +18,9 @@ import QtQuick 2.4
1818import Ubuntu.Components 1.3
1919import Unity.Application 0.1
2020
21−Item {
21+FocusScope {
2222 id: root
23+ objectName: "childWindow"
2324
2425 // Set from outside.
2526 property var surface
@@ -43,6 +44,7 @@ Item {
4344 readonly property bool decorated: surface ? surface.type === Mir.UtilityType
4445 || surface.type === Mir.DialogType
4546 || surface.type === Mir.NormalType
47+ || surface.type === Mir.SatelliteType
4648 : false
4749
4850 readonly property bool moveable: decorated
@@ -100,7 +102,10 @@ Item {
100102 height: units.gu(3)
101103 title: root.surface ? root.surface.name : ""
102104 active: root.surface ? root.surface.focused : false
103− closeButtonVisible: false
105+ closeButtonVisible: root.surface ? root.surface.type === Mir.SatelliteType
106+ || root.surface.type === Mir.NormalType
107+ || root.surface.type === Mir.UtilityType
108+ : false
104109 minimizeButtonVisible: false
105110 maximizeButtonShown: false
106111 onPressed: root.surface.activate();
@@ -109,6 +114,7 @@ Item {
109114 d.moveHandler.handlePositionChanged(mouse);
110115 }
111116 onReleased: if (d.moveHandler) { d.moveHandler.handleReleased(); }
117+ onCloseClicked: root.surface.close();
112118 }
113119 }
114120 }
@@ -141,6 +147,8 @@ Item {
141147 // TODO ChildWindow parent will probably want to control those
142148 interactive: true
143149 consumesInput: true
150+
151+ focus: true
144152 }
145153
146154 Loader {