on xenial help sign in
fix maximized apps behavior (panel, resize cursor, focus switching, ...)
commitb071a6636648a1e26872b79e7262f8339f932e20 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateSat 7 Nov 2015, 03:21 (11 years ago) parent9974bf9
5 files changed+16−8
qml/Components/PanelState/PanelState.qml+1 qml/Panel/Panel.qml+7−1 qml/Stages/DecoratedWindow.qml+4−2 qml/Stages/DesktopStage.qml+3−4 qml/Stages/WindowResizeArea.qml+1−1
qml/Components/PanelState/PanelState.qml+1
@@ -27,4 +27,5 @@ QtObject {
2727 signal close()
2828 signal minimize()
2929 signal maximize()
30+ signal focusMaximizedApp()
3031}
qml/Panel/Panel.qml+7−1
@@ -108,7 +108,13 @@ Item {
108108 }
109109 height: indicators.minimizedPanelHeight
110110 hoverEnabled: true
111− onClicked: { if (callHint.visible) { callHint.showLiveCall(); } }
111+ onClicked: {
112+ if (callHint.visible) {
113+ callHint.showLiveCall();
114+ } else {
115+ PanelState.focusMaximizedApp();
116+ }
117+ }
112118 onDoubleClicked: PanelState.maximize()
113119
114120 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
qml/Stages/DecoratedWindow.qml+4−2
@@ -59,6 +59,7 @@ FocusScope {
5959 }
6060 source: "graphics/dropshadow2gu.sci"
6161 opacity: root.shadowOpacity * .3
62+ enabled: !fullscreen
6263 }
6364
6465 WindowDecoration {
@@ -68,12 +69,13 @@ FocusScope {
6869 anchors { left: parent.left; top: parent.top; right: parent.right }
6970 height: units.gu(3)
7071 width: root.width
71− title: window.title !== "" ? window.title : ""
72+ title: window.title
73+ visible: !root.fullscreen
74+
7275 onClose: root.close();
7376 onMaximize: { root.decorationPressed(); root.maximize(); }
7477 onMinimize: root.minimize();
7578 onPressed: root.decorationPressed();
76− visible: window && !window.fullscreen
7779 }
7880
7981 ApplicationWindow {
qml/Stages/DesktopStage.qml+3−4
@@ -58,10 +58,6 @@ AbstractStage {
5858 spread.cancel();
5959 }
6060 }
61−
62− onRowsInserted: priv.updateForegroundMaximizedApp()
63− onRowsRemoved: priv.updateForegroundMaximizedApp()
64− onRowsMoved: priv.updateForegroundMaximizedApp()
6561 }
6662
6763 GlobalShortcut {
@@ -120,6 +116,8 @@ AbstractStage {
120116 var index = indexOf(focusedAppId);
121117 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
122118 }
119+ onFocusedAppDelegateChanged: updateForegroundMaximizedApp();
120+
123121 property int foregroundMaximizedAppIdIndex: -1
124122
125123 function updateForegroundMaximizedApp() {
@@ -177,6 +175,7 @@ AbstractStage {
177175 onMinimize: priv.focusedAppDelegate && priv.focusedAppDelegate.minimize();
178176 onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel
179177 && priv.focusedAppDelegate.restore();
178+ onFocusMaximizedApp: ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIdIndex).appId)
180179 }
181180
182181 Binding {
qml/Stages/WindowResizeArea.qml+1−1
@@ -24,7 +24,7 @@ MouseArea {
2424 anchors.fill: target
2525 anchors.margins: -borderThickness
2626
27− hoverEnabled: true
27+ hoverEnabled: target && !target.maximized // don't grab the resize under the panel
2828
2929 property var windowStateStorage: WindowStateStorage
3030