@@ -45,6 +45,9 @@ AbstractStage {
45 // Used by TutorialRight
45 // Used by TutorialRight
46 property bool spreadShown: spread.state == "altTab"
46 property bool spreadShown: spread.state == "altTab"
48+ // used by the snap windows (edge maximize) feature
49+ readonly property alias previewRectangle: fakeRectangle
48 mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
51 mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
50 // application windows never rotate independently
53 // application windows never rotate independently
@@ -73,28 +76,27 @@ AbstractStage {
73 id: maximizeWindowShortcut
76 id: maximizeWindowShortcut
74 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
77 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
75 onTriggered: priv.focusedAppDelegate.maximize()
78 onTriggered: priv.focusedAppDelegate.maximize()
76− active: priv.focusedAppDelegate !== null
79+ active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximized
79 GlobalShortcut {
82 GlobalShortcut {
80 id: maximizeWindowLeftShortcut
83 id: maximizeWindowLeftShortcut
81 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Left
84 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Left
82 onTriggered: priv.focusedAppDelegate.maximizeLeft()
85 onTriggered: priv.focusedAppDelegate.maximizeLeft()
83− active: priv.focusedAppDelegate !== null
86+ active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximizedLeftRight
86 GlobalShortcut {
89 GlobalShortcut {
87 id: maximizeWindowRightShortcut
90 id: maximizeWindowRightShortcut
88 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Right
91 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Right
89 onTriggered: priv.focusedAppDelegate.maximizeRight()
92 onTriggered: priv.focusedAppDelegate.maximizeRight()
90− active: priv.focusedAppDelegate !== null
93+ active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximizedLeftRight
93 GlobalShortcut {
96 GlobalShortcut {
94 id: minimizeRestoreShortcut
97 id: minimizeRestoreShortcut
95 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Down
98 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Down
96− onTriggered: priv.focusedAppDelegate.maximized || priv.focusedAppDelegate.maximizedLeft || priv.focusedAppDelegate.maximizedRight ||
99+ onTriggered: priv.focusedAppDelegate.anyMaximized
97− priv.focusedAppDelegate.maximizedHorizontally || priv.focusedAppDelegate.maximizedVertically
98 ? priv.focusedAppDelegate.restoreFromMaximized() : priv.focusedAppDelegate.minimize()
100 ? priv.focusedAppDelegate.restoreFromMaximized() : priv.focusedAppDelegate.minimize()
99 active: priv.focusedAppDelegate !== null
101 active: priv.focusedAppDelegate !== null
@@ -170,11 +172,6 @@ AbstractStage {
170 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
172 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
171 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.minimize(); } }
173 onMinimizeClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.minimize(); } }
172 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.restoreFromMaximized(); } }
174 onRestoreClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.restoreFromMaximized(); } }
173− onFocusMaximizedApp: {
174− if (priv.foregroundMaximizedAppDelegate) {
175− priv.foregroundMaximizedAppDelegate.focus = true;
180 Binding {
177 Binding {
@@ -279,7 +276,7 @@ AbstractStage {
279 value: appDelegate.requestedY -
276 value: appDelegate.requestedY -
280 Math.min(appDelegate.requestedY - PanelState.panelHeight,
277 Math.min(appDelegate.requestedY - PanelState.panelHeight,
281 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
278 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
282− when: root.oskEnabled && appDelegate.focus && appDelegate.state == "normal"
279+ when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
283 && SurfaceManager.inputMethodSurface
280 && SurfaceManager.inputMethodSurface
284 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
281 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
285 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
282 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
@@ -294,7 +291,7 @@ AbstractStage {
294 onShellOrientationAngleChanged: {
291 onShellOrientationAngleChanged: {
295 // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle
292 // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle
296 if (application && application.rotatesWindowContents) {
293 if (application && application.rotatesWindowContents) {
297− if (state == "normal") {
294+ if (state == "normal" || state == "restored") {
298 var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;
295 var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;
299 angleDiff = (360 + angleDiff) % 360;
296 angleDiff = (360 + angleDiff) % 360;
300 if (angleDiff === 90 || angleDiff === 270) {
297 if (angleDiff === 90 || angleDiff === 270) {
@@ -320,14 +317,29 @@ AbstractStage {
320 property int requestedWidth: -1
317 property int requestedWidth: -1
321 property int requestedHeight: -1
318 property int requestedHeight: -1
323− readonly property bool maximized: windowState & WindowStateStorage.WindowStateMaximized
320+ readonly property bool maximized: windowState === WindowStateStorage.WindowStateMaximized
324− readonly property bool maximizedLeft: windowState & WindowStateStorage.WindowStateMaximizedLeft
321+ readonly property bool maximizedLeft: windowState === WindowStateStorage.WindowStateMaximizedLeft
325− readonly property bool maximizedRight: windowState & WindowStateStorage.WindowStateMaximizedRight
322+ readonly property bool maximizedRight: windowState === WindowStateStorage.WindowStateMaximizedRight
326− readonly property bool maximizedHorizontally: windowState & WindowStateStorage.WindowStateMaximizedHorizontally
323+ readonly property bool maximizedHorizontally: windowState === WindowStateStorage.WindowStateMaximizedHorizontally
327− readonly property bool maximizedVertically: windowState & WindowStateStorage.WindowStateMaximizedVertically
324+ readonly property bool maximizedVertically: windowState === WindowStateStorage.WindowStateMaximizedVertically
325+ readonly property bool maximizedTopLeft: windowState === WindowStateStorage.WindowStateMaximizedTopLeft
326+ readonly property bool maximizedTopRight: windowState === WindowStateStorage.WindowStateMaximizedTopRight
327+ readonly property bool maximizedBottomLeft: windowState === WindowStateStorage.WindowStateMaximizedBottomLeft
328+ readonly property bool maximizedBottomRight: windowState === WindowStateStorage.WindowStateMaximizedBottomRight
329+ readonly property bool anyMaximized: maximized || maximizedLeft || maximizedRight || maximizedHorizontally || maximizedVertically ||
330+ maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
328 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
332 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
329 readonly property alias fullscreen: decoratedWindow.fullscreen
333 readonly property alias fullscreen: decoratedWindow.fullscreen
335+ readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
336+ readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
337+ (maximumHeight == 0 || maximumHeight >= appContainer.height)
338+ readonly property bool canBeCornerMaximized: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
339+ (maximumHeight == 0 || maximumHeight >= appContainer.height/2)
340+ readonly property bool canBeMaximizedHorizontally: maximumWidth == 0 || maximumWidth >= appContainer.width
341+ readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height
331 property int windowState: WindowStateStorage.WindowStateNormal
343 property int windowState: WindowStateStorage.WindowStateNormal
332 property bool animationsEnabled: true
344 property bool animationsEnabled: true
333 property alias title: decoratedWindow.title
345 property alias title: decoratedWindow.title
@@ -338,6 +350,7 @@ AbstractStage {
338 readonly property var surface: model.surface
350 readonly property var surface: model.surface
339 readonly property alias resizeArea: resizeArea
351 readonly property alias resizeArea: resizeArea
340 readonly property alias focusedSurface: decoratedWindow.focusedSurface
352 readonly property alias focusedSurface: decoratedWindow.focusedSurface
353+ readonly property bool dragging: touchControls.overlayShown ? touchControls.dragging : decoratedWindow.dragging
342 readonly property bool isDash: model.application.appId == "unity8-dash"
355 readonly property bool isDash: model.application.appId == "unity8-dash"
343 readonly property alias clientAreaItem: decoratedWindow.clientAreaItem
356 readonly property alias clientAreaItem: decoratedWindow.clientAreaItem
@@ -346,7 +359,7 @@ AbstractStage {
346 if (spread.state == "altTab") {
359 if (spread.state == "altTab") {
347 spread.cancel();
360 spread.cancel();
349− appDelegate.restore();
362+ appDelegate.restore(true /* animated */, appDelegate.windowState);
351 Connections {
364 Connections {
352 target: model.surface
365 target: model.surface
@@ -454,28 +467,34 @@ AbstractStage {
454 animationsEnabled = (animated === undefined) || animated;
467 animationsEnabled = (animated === undefined) || animated;
455 windowState = WindowStateStorage.WindowStateMaximizedVertically;
468 windowState = WindowStateStorage.WindowStateMaximizedVertically;
470+ function maximizeTopLeft(animated) {
471+ animationsEnabled = (animated === undefined) || animated;
472+ windowState = WindowStateStorage.WindowStateMaximizedTopLeft;
474+ function maximizeTopRight(animated) {
475+ animationsEnabled = (animated === undefined) || animated;
476+ windowState = WindowStateStorage.WindowStateMaximizedTopRight;
478+ function maximizeBottomLeft(animated) {
479+ animationsEnabled = (animated === undefined) || animated;
480+ windowState = WindowStateStorage.WindowStateMaximizedBottomLeft;
482+ function maximizeBottomRight(animated) {
483+ animationsEnabled = (animated === undefined) || animated;
484+ windowState = WindowStateStorage.WindowStateMaximizedBottomRight;
457 function minimize(animated) {
486 function minimize(animated) {
458 animationsEnabled = (animated === undefined) || animated;
487 animationsEnabled = (animated === undefined) || animated;
459 windowState |= WindowStateStorage.WindowStateMinimized; // add the minimized bit
488 windowState |= WindowStateStorage.WindowStateMinimized; // add the minimized bit
461 function restoreFromMaximized(animated) {
490 function restoreFromMaximized(animated) {
462 animationsEnabled = (animated === undefined) || animated;
491 animationsEnabled = (animated === undefined) || animated;
463− windowState = WindowStateStorage.WindowStateNormal;
492+ windowState = WindowStateStorage.WindowStateRestored;
465− function restore(animated) {
494+ function restore(animated,state) {
466 animationsEnabled = (animated === undefined) || animated;
495 animationsEnabled = (animated === undefined) || animated;
496+ windowState = state || WindowStateStorage.WindowStateRestored;
467 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
497 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
470− else if (maximizedLeft)
472− else if (maximizedRight)
474− else if (maximizedHorizontally)
475− maximizeHorizontally();
476− else if (maximizedVertically)
477− maximizeVertically();
479 focus = true;
498 focus = true;
@@ -492,9 +511,14 @@ AbstractStage {
492 duration: UbuntuAnimation.SnapDuration
511 duration: UbuntuAnimation.SnapDuration
514+ // unlike requestedX/Y, this is the last known grab position before being pushed against edges/corners
515+ // when restoring, the window should return to these, not to the place where it was dropped near the edge
516+ property real restoredX
517+ property real restoredY
495 states: [
519 states: [
497− name: "fullscreen"; when: decoratedWindow.fullscreen && !appDelegate.minimized
521+ name: "fullscreen"; when: appDelegate.fullscreen && !appDelegate.minimized
498 PropertyChanges {
522 PropertyChanges {
499 target: appDelegate;
523 target: appDelegate;
500 x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight)
524 x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight)
@@ -513,61 +537,94 @@ AbstractStage {
516− name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized
540+ name: "restored";
541+ when: appDelegate.windowState == WindowStateStorage.WindowStateRestored
517 PropertyChanges {
543 PropertyChanges {
518 target: appDelegate;
544 target: appDelegate;
519− x: root.leftMargin;
545+ requestedX: restoredX;
520− y: 0;
546+ requestedY: restoredY;
521− visuallyMinimized: false;
522− visuallyMaximized: true
550+ name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized
524 PropertyChanges {
551 PropertyChanges {
525− target: decoratedWindow
552+ target: appDelegate;
553+ requestedX: root.leftMargin;
526 requestedWidth: appContainer.width - root.leftMargin;
555 requestedWidth: appContainer.width - root.leftMargin;
527 requestedHeight: appContainer.height;
556 requestedHeight: appContainer.height;
557+ visuallyMinimized: false;
558+ visuallyMaximized: true
531 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
562 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
532 PropertyChanges {
563 PropertyChanges {
533 target: appDelegate
564 target: appDelegate
534− x: root.leftMargin
565+ requestedX: root.leftMargin
535− y: PanelState.panelHeight
566+ requestedY: PanelState.panelHeight
538− target: decoratedWindow
539 requestedWidth: (appContainer.width - root.leftMargin)/2
567 requestedWidth: (appContainer.width - root.leftMargin)/2
540 requestedHeight: appContainer.height - PanelState.panelHeight
568 requestedHeight: appContainer.height - PanelState.panelHeight
544 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
572 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
573+ extend: "maximizedLeft"
545 PropertyChanges {
574 PropertyChanges {
546 target: appDelegate;
575 target: appDelegate;
547− x: (appContainer.width + root.leftMargin)/2
576+ requestedX: (appContainer.width + root.leftMargin)/2
548− y: PanelState.panelHeight
580+ name: "maximizedTopLeft"; when: appDelegate.maximizedTopLeft && !appDelegate.minimized
550 PropertyChanges {
581 PropertyChanges {
551− target: decoratedWindow
582+ target: appDelegate
583+ requestedX: root.leftMargin
584+ requestedY: PanelState.panelHeight
552 requestedWidth: (appContainer.width - root.leftMargin)/2
585 requestedWidth: (appContainer.width - root.leftMargin)/2
553− requestedHeight: appContainer.height - PanelState.panelHeight
586+ requestedHeight: (appContainer.height - PanelState.panelHeight)/2
590+ name: "maximizedTopRight"; when: appDelegate.maximizedTopRight && !appDelegate.minimized
591+ extend: "maximizedTopLeft"
594+ requestedX: (appContainer.width + root.leftMargin)/2
598+ name: "maximizedBottomLeft"; when: appDelegate.maximizedBottomLeft && !appDelegate.minimized
601+ requestedX: root.leftMargin
602+ requestedY: (appContainer.height + PanelState.panelHeight)/2
603+ requestedWidth: (appContainer.width - root.leftMargin)/2
604+ requestedHeight: appContainer.height/2
608+ name: "maximizedBottomRight"; when: appDelegate.maximizedBottomRight && !appDelegate.minimized
609+ extend: "maximizedBottomLeft"
612+ requestedX: (appContainer.width + root.leftMargin)/2
557 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
616 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
558− PropertyChanges { target: appDelegate; x: root.leftMargin }
617+ PropertyChanges { target: appDelegate; requestedX: root.leftMargin; requestedY: requestedY; requestedWidth: appContainer.width - root.leftMargin }
559− PropertyChanges { target: decoratedWindow; requestedWidth: appContainer.width - root.leftMargin }
562 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
620 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
563− PropertyChanges { target: appDelegate; y: PanelState.panelHeight }
621+ PropertyChanges { target: appDelegate; requestedX: requestedX; requestedY: PanelState.panelHeight; requestedHeight: appContainer.height - PanelState.panelHeight }
564− PropertyChanges { target: decoratedWindow; requestedHeight: appContainer.height - PanelState.panelHeight }
567 name: "minimized"; when: appDelegate.minimized
624 name: "minimized"; when: appDelegate.minimized
568 PropertyChanges {
625 PropertyChanges {
569 target: appDelegate;
626 target: appDelegate;
570− x: -appDelegate.width / 2;
627+ requestedX: -appDelegate.width / 2;
571 scale: units.gu(5) / appDelegate.width;
628 scale: units.gu(5) / appDelegate.width;
572 opacity: 0;
629 opacity: 0;
573 visuallyMinimized: true;
630 visuallyMinimized: true;
@@ -577,21 +634,17 @@ AbstractStage {
578 transitions: [
635 transitions: [
579 Transition {
636 Transition {
580− to: "normal"
637+ to: "normal,restored"
581 enabled: appDelegate.animationsEnabled
638 enabled: appDelegate.animationsEnabled
582 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
639 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
583− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
640+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }
584− UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
586 Transition {
642 Transition {
587 to: "minimized"
643 to: "minimized"
588 enabled: appDelegate.animationsEnabled
644 enabled: appDelegate.animationsEnabled
589 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
645 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
590 SequentialAnimation {
646 SequentialAnimation {
592− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration }
647+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }
593− UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
595 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
648 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
596 ScriptAction {
649 ScriptAction {
597 script: {
650 script: {
@@ -608,11 +661,9 @@ AbstractStage {
608 enabled: appDelegate.animationsEnabled
661 enabled: appDelegate.animationsEnabled
609 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
662 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
610 SequentialAnimation {
663 SequentialAnimation {
612− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration }
664+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }
613− UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
615 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
665 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
666+ ScriptAction { script: { fakeRectangle.stop(); } }
@@ -678,27 +729,38 @@ AbstractStage {
678 surface: model.surface
729 surface: model.surface
679 active: appDelegate.focus
730 active: appDelegate.focus
680 focus: true
731 focus: true
681− maximizeButtonShown: (maximumWidth == 0 || maximumWidth >= appContainer.width) &&
732+ maximizeButtonShown: appDelegate.canBeMaximized
682− (maximumHeight == 0 || maximumHeight >= appContainer.height)
683 overlayShown: touchControls.overlayShown
733 overlayShown: touchControls.overlayShown
734+ stageWidth: appContainer.width
735+ stageHeight: appContainer.height
685 requestedWidth: appDelegate.requestedWidth
737 requestedWidth: appDelegate.requestedWidth
686 requestedHeight: appDelegate.requestedHeight
738 requestedHeight: appDelegate.requestedHeight
688 onCloseClicked: { appDelegate.close(); }
740 onCloseClicked: { appDelegate.close(); }
689− onMaximizeClicked: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight
690− || appDelegate.maximizedHorizontally || appDelegate.maximizedVertically
691− ? appDelegate.restoreFromMaximized() : appDelegate.maximize()
741+ onMaximizeClicked: appDelegate.anyMaximized ? appDelegate.restoreFromMaximized() : appDelegate.maximize();
692 onMaximizeHorizontallyClicked: appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()
742 onMaximizeHorizontallyClicked: appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()
693 onMaximizeVerticallyClicked: appDelegate.maximizedVertically ? appDelegate.restoreFromMaximized() : appDelegate.maximizeVertically()
743 onMaximizeVerticallyClicked: appDelegate.maximizedVertically ? appDelegate.restoreFromMaximized() : appDelegate.maximizeVertically()
694 onMinimizeClicked: appDelegate.minimize()
744 onMinimizeClicked: appDelegate.minimize()
695 onDecorationPressed: { appDelegate.focus = true; }
745 onDecorationPressed: { appDelegate.focus = true; }
746+ onDecorationReleased: fakeRectangle.commit();
698 WindowControlsOverlay {
749 WindowControlsOverlay {
699 id: touchControls
750 id: touchControls
700− anchors.fill: appDelegate
701 target: appDelegate
751 target: appDelegate
752+ stageWidth: appContainer.width
753+ stageHeight: appContainer.height
755+ onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
756+ onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
757+ onFakeMaximizeRightAnimationRequested: if (!appDelegate.maximizedRight) fakeRectangle.maximizeRight(amount, true)
758+ onFakeMaximizeTopLeftAnimationRequested: if (!appDelegate.maximizedTopLeft) fakeRectangle.maximizeTopLeft(amount, true);
759+ onFakeMaximizeTopRightAnimationRequested: if (!appDelegate.maximizedTopRight) fakeRectangle.maximizeTopRight(amount, true);
760+ onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
761+ onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
762+ onStopFakeAnimation: fakeRectangle.stop();
763+ onDragReleased: fakeRectangle.commit();
704 WindowedFullscreenPolicy {
766 WindowedFullscreenPolicy {
@@ -710,6 +772,14 @@ AbstractStage {
775+ FakeMaximizeDelegate {
777+ target: priv.focusedAppDelegate
778+ leftMargin: root.leftMargin
779+ appContainerWidth: appContainer.width
780+ appContainerHeight: appContainer.height
713 EdgeBarrier {
783 EdgeBarrier {
714 id: edgeBarrier
784 id: edgeBarrier