on xenial help sign in
fix maximized apps behavior (panel, resize cursor, focus switching, ...)
b071a66Lukáš Tinkl
qml/Components/PanelState/PanelState.qml+1
@@ -27,4 +27,5 @@ QtObject {
27 signal close()
27 signal close()
28 signal minimize()
28 signal minimize()
29 signal maximize()
29 signal maximize()
30+ signal focusMaximizedApp()
30}
31}
qml/Panel/Panel.qml+7−1
@@ -108,7 +108,13 @@ Item {
108 }
108 }
109 height: indicators.minimizedPanelHeight
109 height: indicators.minimizedPanelHeight
110 hoverEnabled: true
110 hoverEnabled: true
111+ onClicked: {
112+ if (callHint.visible) {
111− onClicked: { if (callHint.visible) { callHint.showLiveCall(); } }
113+ callHint.showLiveCall();
114+ } else {
115+ PanelState.focusMaximizedApp();
116+ }
117+ }
112 onDoubleClicked: PanelState.maximize()
118 onDoubleClicked: PanelState.maximize()
113
119
114 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
120 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
qml/Stages/DecoratedWindow.qml+4−2
@@ -59,6 +59,7 @@ FocusScope {
59 }
59 }
60 source: "graphics/dropshadow2gu.sci"
60 source: "graphics/dropshadow2gu.sci"
61 opacity: root.shadowOpacity * .3
61 opacity: root.shadowOpacity * .3
62+ enabled: !fullscreen
62 }
63 }
63
64
64 WindowDecoration {
65 WindowDecoration {
@@ -68,12 +69,13 @@ FocusScope {
68 anchors { left: parent.left; top: parent.top; right: parent.right }
69 anchors { left: parent.left; top: parent.top; right: parent.right }
69 height: units.gu(3)
70 height: units.gu(3)
70 width: root.width
71 width: root.width
71− title: window.title !== "" ? window.title : ""
72+ title: window.title
73+ visible: !root.fullscreen
74+
72 onClose: root.close();
75 onClose: root.close();
73 onMaximize: { root.decorationPressed(); root.maximize(); }
76 onMaximize: { root.decorationPressed(); root.maximize(); }
74 onMinimize: root.minimize();
77 onMinimize: root.minimize();
75 onPressed: root.decorationPressed();
78 onPressed: root.decorationPressed();
76− visible: window && !window.fullscreen
77 }
79 }
78
80
79 ApplicationWindow {
81 ApplicationWindow {
qml/Stages/DesktopStage.qml+3−4
@@ -58,10 +58,6 @@ AbstractStage {
58 spread.cancel();
58 spread.cancel();
59 }
59 }
60 }
60 }
61−
62− onRowsInserted: priv.updateForegroundMaximizedApp()
63− onRowsRemoved: priv.updateForegroundMaximizedApp()
64− onRowsMoved: priv.updateForegroundMaximizedApp()
65 }
61 }
66
62
67 GlobalShortcut {
63 GlobalShortcut {
@@ -120,6 +116,8 @@ AbstractStage {
120 var index = indexOf(focusedAppId);
116 var index = indexOf(focusedAppId);
121 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
117 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
122 }
118 }
119+ onFocusedAppDelegateChanged: updateForegroundMaximizedApp();
120+
123 property int foregroundMaximizedAppIdIndex: -1
121 property int foregroundMaximizedAppIdIndex: -1
124
122
125 function updateForegroundMaximizedApp() {
123 function updateForegroundMaximizedApp() {
@@ -177,6 +175,7 @@ AbstractStage {
177 onMinimize: priv.focusedAppDelegate && priv.focusedAppDelegate.minimize();
175 onMinimize: priv.focusedAppDelegate && priv.focusedAppDelegate.minimize();
178 onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel
176 onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel
179 && priv.focusedAppDelegate.restore();
177 && priv.focusedAppDelegate.restore();
178+ onFocusMaximizedApp: ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIdIndex).appId)
180 }
179 }
181
180
182 Binding {
181 Binding {
qml/Stages/WindowResizeArea.qml+1−1
@@ -24,7 +24,7 @@ MouseArea {
24 anchors.fill: target
24 anchors.fill: target
25 anchors.margins: -borderThickness
25 anchors.margins: -borderThickness
26
26
27− hoverEnabled: true
27+ hoverEnabled: target && !target.maximized // don't grab the resize under the panel
28
28
29 property var windowStateStorage: WindowStateStorage
29 property var windowStateStorage: WindowStateStorage
30
30