@@ -255,8 +255,8 @@ AbstractStage {
255 focus: appId === priv.focusedAppId
255 focus: appId === priv.focusedAppId
256 width: decoratedWindow.width
256 width: decoratedWindow.width
257 height: decoratedWindow.height
257 height: decoratedWindow.height
258− property alias requestedWidth: decoratedWindow.requestedWidth
258+ property int requestedWidth: -1
259− property alias requestedHeight: decoratedWindow.requestedHeight
259+ property int requestedHeight: -1
260 property alias minimumWidth: decoratedWindow.minimumWidth
260 property alias minimumWidth: decoratedWindow.minimumWidth
261 property alias minimumHeight: decoratedWindow.minimumHeight
261 property alias minimumHeight: decoratedWindow.minimumHeight
262 property alias maximumWidth: decoratedWindow.maximumWidth
262 property alias maximumWidth: decoratedWindow.maximumWidth
@@ -388,20 +388,40 @@ AbstractStage {
388 PropertyChanges {
388 PropertyChanges {
389 target: appDelegate;
389 target: appDelegate;
390 x: root.leftMargin; y: 0;
390 x: root.leftMargin; y: 0;
391− requestedWidth: appContainer.width - root.leftMargin; requestedHeight: appContainer.height;
392 visuallyMinimized: false;
391 visuallyMinimized: false;
393 visuallyMaximized: true
392 visuallyMaximized: true
395+ target: decoratedWindow
396+ requestedWidth: root.width;
397+ requestedHeight: root.height;
397 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
401 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
398− PropertyChanges { target: appDelegate; x: root.leftMargin; y: PanelState.panelHeight;
405+ y: PanelState.panelHeight
408+ target: decoratedWindow
409+ requestedWidth: (appContainer.width - root.leftMargin)/2
399− requestedWidth: (appContainer.width - root.leftMargin)/2; requestedHeight: appContainer.height - PanelState.panelHeight }
410+ requestedHeight: appContainer.height - PanelState.panelHeight
402 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
414 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
416+ target: appDelegate;
403− PropertyChanges { target: appDelegate; x: (appContainer.width + root.leftMargin)/2; y: PanelState.panelHeight;
417+ x: (appContainer.width + root.leftMargin)/2
418+ y: PanelState.panelHeight
421+ target: decoratedWindow
422+ requestedWidth: (appContainer.width - root.leftMargin)/2
404− requestedWidth: (appContainer.width - root.leftMargin)/2; requestedHeight: appContainer.height - PanelState.panelHeight }
423+ requestedHeight: appContainer.height - PanelState.panelHeight
407 name: "minimized"; when: appDelegate.minimized
427 name: "minimized"; when: appDelegate.minimized
@@ -421,13 +441,17 @@ AbstractStage {
421 enabled: appDelegate.animationsEnabled
441 enabled: appDelegate.animationsEnabled
422 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
442 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
423 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
443 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
444+ UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
425 Transition {
446 Transition {
426 to: "minimized"
447 to: "minimized"
427 enabled: appDelegate.animationsEnabled
448 enabled: appDelegate.animationsEnabled
428 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
449 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
429 SequentialAnimation {
450 SequentialAnimation {
452+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration }
430− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
453+ UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
431 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
455 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
432 ScriptAction {
456 ScriptAction {
433 script: {
457 script: {
@@ -443,7 +467,10 @@ AbstractStage {
443 enabled: appDelegate.animationsEnabled
467 enabled: appDelegate.animationsEnabled
444 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
468 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
445 SequentialAnimation {
469 SequentialAnimation {
471+ UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration }
446− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
472+ UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
447 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
474 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
@@ -458,6 +485,7 @@ AbstractStage {
460 WindowResizeArea {
487 WindowResizeArea {
461 objectName: "windowResizeArea"
489 objectName: "windowResizeArea"
462 target: appDelegate
490 target: appDelegate
463 minWidth: units.gu(10)
491 minWidth: units.gu(10)
@@ -469,6 +497,21 @@ AbstractStage {
469 leftMargin: root.leftMargin
497 leftMargin: root.leftMargin
471 onPressed: { ApplicationManager.focusApplication(model.appId) }
499 onPressed: { ApplicationManager.focusApplication(model.appId) }
501+ property bool saveStateOnDestruction: true
504+ onStageAboutToBeUnloaded: {
505+ resizeArea.saveWindowState();
506+ resizeArea.saveStateOnDestruction = false;
507+ fullscreenPolicy.active = false;
510+ Component.onDestruction: {
511+ if (saveStateOnDestruction) {
474 DecoratedWindow {
517 DecoratedWindow {
@@ -480,12 +523,21 @@ AbstractStage {
480 active: ApplicationManager.focusedApplicationId === model.appId
523 active: ApplicationManager.focusedApplicationId === model.appId
481 focus: true
524 focus: true
526+ requestedWidth: appDelegate.requestedWidth
527+ requestedHeight: appDelegate.requestedHeight
483 onClose: ApplicationManager.stopApplication(model.appId)
529 onClose: ApplicationManager.stopApplication(model.appId)
484 onMaximize: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight
530 onMaximize: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight
485 ? appDelegate.restoreFromMaximized() : appDelegate.maximize()
531 ? appDelegate.restoreFromMaximized() : appDelegate.maximize()
486 onMinimize: appDelegate.minimize()
532 onMinimize: appDelegate.minimize()
487 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
533 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
536+ WindowedFullscreenPolicy {
537+ id: fullscreenPolicy
539+ application: decoratedWindow.application