@@ -879,13 +879,7 @@ FocusScope {
879 } else if (model.window.state === Mir.MaximizedBottomRightState) {
879 } else if (model.window.state === Mir.MaximizedBottomRightState) {
880 appDelegate.maximizeBottomRight();
880 appDelegate.maximizeBottomRight();
881 } else if (model.window.state === Mir.RestoredState) {
881 } else if (model.window.state === Mir.RestoredState) {
882− if (decoratedWindow.dragging) {
883− appDelegate.restore(false, WindowStateStorage.WindowStateNormal);
882+ appDelegate.restore();
884− } else if (appDelegate.anyMaximized) {
885− appDelegate.restoreFromMaximized()
887− appDelegate.restore();
@@ -918,7 +912,6 @@ FocusScope {
918 if (visuallyMaximized) {
912 if (visuallyMaximized) {
919 priv.updateForegroundMaximizedApp();
913 priv.updateForegroundMaximizedApp();
924 onVisuallyMaximizedChanged: priv.updateForegroundMaximizedApp()
917 onVisuallyMaximizedChanged: priv.updateForegroundMaximizedApp()
@@ -982,10 +975,6 @@ FocusScope {
982 animationsEnabled = (animated === undefined) || animated;
975 animationsEnabled = (animated === undefined) || animated;
983 windowState |= WindowStateStorage.WindowStateMinimized; // add the minimized bit
976 windowState |= WindowStateStorage.WindowStateMinimized; // add the minimized bit
985− function restoreFromMaximized(animated) {
986− animationsEnabled = (animated === undefined) || animated;
987− windowState = WindowStateStorage.WindowStateRestored;
989 function restore(animated,state) {
978 function restore(animated,state) {
990 animationsEnabled = (animated === undefined) || animated;
979 animationsEnabled = (animated === undefined) || animated;
991 windowState = state || WindowStateStorage.WindowStateRestored;
980 windowState = state || WindowStateStorage.WindowStateRestored;
@@ -1304,15 +1293,9 @@ FocusScope {
1304 windowedY: restoredY;
1293 windowedY: restoredY;
1308− name: "semiMaximized"
1309− PropertyChanges { target: touchControls; enabled: true }
1310− PropertyChanges { target: resizeArea; enabled: true }
1311− PropertyChanges { target: decoratedWindow; shadowOpacity: .3 }
1314 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
1297 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
1315− extend: "semiMaximized"
1298+ extend: "restored"
1316 PropertyChanges {
1299 PropertyChanges {
1317 target: appDelegate
1300 target: appDelegate
1318 windowedX: root.leftMargin
1301 windowedX: root.leftMargin
@@ -1331,7 +1314,7 @@ FocusScope {
1333 name: "maximizedTopLeft"; when: appDelegate.maximizedTopLeft && !appDelegate.minimized
1316 name: "maximizedTopLeft"; when: appDelegate.maximizedTopLeft && !appDelegate.minimized
1334− extend: "semiMaximized"
1317+ extend: "restored"
1335 PropertyChanges {
1318 PropertyChanges {
1336 target: appDelegate
1319 target: appDelegate
1337 windowedX: root.leftMargin
1320 windowedX: root.leftMargin
@@ -1350,7 +1333,7 @@ FocusScope {
1352 name: "maximizedBottomLeft"; when: appDelegate.maximizedBottomLeft && !appDelegate.minimized
1335 name: "maximizedBottomLeft"; when: appDelegate.maximizedBottomLeft && !appDelegate.minimized
1353− extend: "semiMaximized"
1336+ extend: "restored"
1354 PropertyChanges {
1337 PropertyChanges {
1355 target: appDelegate
1338 target: appDelegate
1356 windowedX: root.leftMargin
1339 windowedX: root.leftMargin
@@ -1369,13 +1352,13 @@ FocusScope {
1371 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
1354 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
1372− extend: "semiMaximized"
1355+ extend: "restored"
1373 PropertyChanges { target: appDelegate; requestedX: root.leftMargin; requestedY: windowedY;
1356 PropertyChanges { target: appDelegate; requestedX: root.leftMargin; requestedY: windowedY;
1374 requestedWidth: appContainer.width - root.leftMargin; requestedHeight: appDelegate.windowedHeight }
1357 requestedWidth: appContainer.width - root.leftMargin; requestedHeight: appDelegate.windowedHeight }
1377 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1360 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
1378− extend: "semiMaximized"
1361+ extend: "restored"
1379 PropertyChanges { target: appDelegate; requestedX: windowedX; requestedY: PanelState.panelHeight;
1362 PropertyChanges { target: appDelegate; requestedX: windowedX; requestedY: PanelState.panelHeight;
1380 requestedWidth: appDelegate.windowedWidth; requestedHeight: appContainer.height - PanelState.panelHeight }
1363 requestedWidth: appDelegate.windowedWidth; requestedHeight: appContainer.height - PanelState.panelHeight }
@@ -1403,14 +1386,6 @@ FocusScope {
1403 to: "staged,stagedWithSideStage"
1386 to: "staged,stagedWithSideStage"
1404 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1387 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1407− from: "maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,minimized";
1408− to: "normal,restored"
1409− enabled: appDelegate.animationsEnabled
1410− PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
1411− UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,windowedX,windowedY,requestedWidth,requestedHeight,windowedWidth,windowedHeight,scale";
1412− duration: priv.animationDuration }
1414 Transition {
1389 Transition {
1415 to: "minimized"
1390 to: "minimized"
1416 enabled: appDelegate.animationsEnabled
1391 enabled: appDelegate.animationsEnabled
@@ -1470,8 +1445,8 @@ FocusScope {
1471 Transition {
1446 Transition {
1472 id: windowedTransition
1447 id: windowedTransition
1473− from: "normal,restored,maximized,maximizedLeft,maximizedRight,maximizedTop,maximizedBottom,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
1448+ from: ",normal,restored,maximized,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen,minimized"
1474− to: "normal,restored,maximized,maximizedLeft,maximizedRight,maximizedTop,maximizedBottom,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
1449+ to: ",normal,restored,maximized,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
1475 enabled: appDelegate.animationsEnabled
1450 enabled: appDelegate.animationsEnabled
1476 SequentialAnimation {
1451 SequentialAnimation {
1477 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
1452 PropertyAction { target: appDelegate; property: "visuallyMinimized" }