@@ -196,18 +196,19 @@ FocusScope {
199− MouseArea {
199+ WindowDecoration {
201+ closeButtonVisible: root.application.appId !== "unity8-dash"
202+ objectName: "appWindowDecoration"
200 anchors { left: parent.left; top: parent.top; right: parent.right }
204 anchors { left: parent.left; top: parent.top; right: parent.right }
201 height: units.gu(3)
205 height: units.gu(3)
203− opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
207+ title: applicationWindow.title
209+ opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
205 Behavior on opacity { UbuntuNumberAnimation { } }
210 Behavior on opacity { UbuntuNumberAnimation { } }
207− drag.target: Item {}
208− drag.filterChildren: true
211 onPressed: root.decorationPressed();
212 onPressed: root.decorationPressed();
212 onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
213 onPressedChanged: moveHandler.handlePressedChanged(pressed, pressedButtons, mouseX, mouseY)
213 onPositionChanged: moveHandler.handlePositionChanged(mouse)
214 onPositionChanged: moveHandler.handlePositionChanged(mouse)
@@ -216,47 +217,39 @@ FocusScope {
216 moveHandler.handleReleased();
217 moveHandler.handleReleased();
221− closeButtonVisible: root.application.appId !== "unity8-dash"
222− objectName: "appWindowDecoration"
223− anchors.fill: parent
224− title: applicationWindow.title
226− onCloseClicked: root.closeClicked();
220+ onCloseClicked: root.closeClicked();
227− onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }
221+ onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }
228− onMaximizeHorizontallyClicked: { root.decorationPressed(); root.maximizeHorizontallyClicked(); }
222+ onMaximizeHorizontallyClicked: { root.decorationPressed(); root.maximizeHorizontallyClicked(); }
229− onMaximizeVerticallyClicked: { root.decorationPressed(); root.maximizeVerticallyClicked(); }
223+ onMaximizeVerticallyClicked: { root.decorationPressed(); root.maximizeVerticallyClicked(); }
230− onMinimizeClicked: root.minimizeClicked();
224+ onMinimizeClicked: root.minimizeClicked();
235− (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)
237− menu: sharedAppModel.model
239− Indicators.SharedUnityMenuModel {
226+ enableMenus: {
240− id: sharedAppModel
227+ return active &&
241− property var menus: surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : []
228+ surface &&
242− property var menuService: menus.length > 0 ? menus[0] : undefined
229+ (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)
231+ menu: sharedAppModel.model
244− busName: menuService ? menuService.service : ""
233+ Indicators.SharedUnityMenuModel {
245− menuObjectPath: menuService && menuService.menuPath ? menuService.menuPath : ""
234+ id: sharedAppModel
246− actions: menuService && menuService.actionPath ? { "unity": menuService.actionPath } : {}
235+ property var menus: surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : []
247− }
236+ property var menuService: menus.length > 0 ? menus[0] : undefined
238+ busName: menuService ? menuService.service : ""
239+ menuObjectPath: menuService && menuService.menuPath ? menuService.menuPath : ""
240+ actions: menuService && menuService.actionPath ? { "unity": menuService.actionPath } : {}
249− Connections {
243+ Connections {
250− target: ApplicationMenuRegistry
244+ target: ApplicationMenuRegistry
251− onSurfaceMenuRegistered: {
245+ onSurfaceMenuRegistered: {
252− if (surface && surfaceId === surface.persistentId) {
246+ if (surface && surfaceId === surface.persistentId) {
253− sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
247+ sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
256− onSurfaceMenuUnregistered: {
249+ }
250+ onSurfaceMenuUnregistered: {
257− if (surface && surfaceId === surface.persistentId) {
251+ if (surface && surfaceId === surface.persistentId) {
258− sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });
252+ sharedAppModel.menus = Qt.binding(function() { return surface ? ApplicationMenuRegistry.getMenusForSurface(surface.persistentId) : [] });