on xenial help sign in
activate/focus/restore windows when clicking on their decoration or
d84f955Lukáš Tinkl
qml/Stages/DesktopStage.qml+6−2
@@ -86,6 +86,11 @@ Rectangle {
86 var index = indexOf(focusedAppId);
86 var index = indexOf(focusedAppId);
87 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
87 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
88 }
88 }
89+ onFocusedAppDelegateChanged: { // restore the window from minimization when we focus it (e.g. using spread)
90+ if (priv.focusedAppDelegate.minimized) {
91+ priv.focusedAppDelegate.unmaximize()
92+ }
93+ }
89
94
90 function indexOf(appId) {
95 function indexOf(appId) {
91 for (var i = 0; i < ApplicationManager.count; i++) {
96 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -222,8 +227,7 @@ Rectangle {
222 minHeight: appDelegate.minHeight
227 minHeight: appDelegate.minHeight
223 resizeHandleWidth: units.gu(2)
228 resizeHandleWidth: units.gu(2)
224 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
229 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
225−
230+ appId: model.appId
226− onPressed: { ApplicationManager.focusApplication(model.appId) }
227 }
231 }
228
232
229 DecoratedWindow {
233 DecoratedWindow {
qml/Stages/WindowMoveResizeArea.qml+3−1
@@ -19,6 +19,7 @@
19import QtQuick 2.3
19import QtQuick 2.3
20import Ubuntu.Components 1.1
20import Ubuntu.Components 1.1
21import Utils 0.1
21import Utils 0.1
22+import Unity.Application 0.1
22
23
23MouseArea {
24MouseArea {
24 id: root
25 id: root
@@ -31,6 +32,7 @@ MouseArea {
31 // The area will anchor to it and manage move and resize events
32 // The area will anchor to it and manage move and resize events
32 property Item target: null
33 property Item target: null
33 property string windowId: ""
34 property string windowId: ""
35+ property string appId: ""
34 property int resizeHandleWidth: 0
36 property int resizeHandleWidth: 0
35 property int minWidth: 0
37 property int minWidth: 0
36 property int minHeight: 0
38 property int minHeight: 0
@@ -46,7 +48,6 @@ MouseArea {
46 property bool resizeBottom: false
48 property bool resizeBottom: false
47 property bool resizeLeft: false
49 property bool resizeLeft: false
48 property bool resizeRight: false
50 property bool resizeRight: false
49−
50 }
51 }
51
52
52 Component.onCompleted: {
53 Component.onCompleted: {
@@ -60,6 +61,7 @@ MouseArea {
60 }
61 }
61
62
62 onPressed: {
63 onPressed: {
64+ ApplicationManager.focusApplication(root.appId)
63 priv.startPoint = Qt.point(mouse.x, mouse.y);
65 priv.startPoint = Qt.point(mouse.x, mouse.y);
64 priv.resizeTop = mouseY < root.resizeHandleWidth;
66 priv.resizeTop = mouseY < root.resizeHandleWidth;
65 priv.resizeBottom = mouseY > (root.height - root.resizeHandleWidth);
67 priv.resizeBottom = mouseY > (root.height - root.resizeHandleWidth);