on xenial help sign in
Fix tiny windows when switching stages

Approved by: Unity8 CI Bot, Albert Astals Cid

commitd2913676e6a45a80bbbd092db1647dc07af86307 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 10 Mar 2016, 22:37 (11 years ago) parent5ffa1ea8824bd1
2 files changed+7−4
qml/Stages/DesktopStage.qml+1 qml/Stages/WindowResizeArea.qml+6−4
qml/Stages/DesktopStage.qml+1
@@ -275,6 +275,7 @@ AbstractStage {
275275 readonly property alias maximizedLeft: appDelegatePrivate.maximizedLeft
276276 readonly property alias maximizedRight: appDelegatePrivate.maximizedRight
277277 readonly property alias minimized: appDelegatePrivate.minimized
278+ readonly property alias fullscreen: decoratedWindow.fullscreen
278279
279280 readonly property string appId: model.appId
280281 property bool animationsEnabled: true
qml/Stages/WindowResizeArea.qml+6−4
@@ -73,10 +73,12 @@ MouseArea {
7373 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
7474 Qt.rect(target.x, target.y, defaultWidth, defaultHeight));
7575
76− target.requestedWidth = Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin);
77− target.requestedHeight = Math.min(Math.max(windowGeometry.height, d.minimumHeight), root.screenHeight - PanelState.panelHeight);
78− target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.requestedWidth), root.leftMargin)
79− target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight)
76+ target.requestedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
77+ target.requestedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
78+ root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });
79+ target.x = Qt.binding(function() { return Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.requestedWidth),
80+ (target.fullscreen ? 0 : root.leftMargin)); });
81+ target.y = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight); });
8082
8183 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
8284 if (windowState === WindowStateStorage.WindowStateMaximized) {