@@ -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
@@ -68,28 +71,27 @@ AbstractStage {
68 id: maximizeWindowShortcut
71 id: maximizeWindowShortcut
69 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
72 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
70 onTriggered: priv.focusedAppDelegate.maximize()
73 onTriggered: priv.focusedAppDelegate.maximize()
71− active: priv.focusedAppDelegate !== null
74+ active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximized
74 GlobalShortcut {
77 GlobalShortcut {
75 id: maximizeWindowLeftShortcut
78 id: maximizeWindowLeftShortcut
76 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Left
79 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Left
77 onTriggered: priv.focusedAppDelegate.maximizeLeft()
80 onTriggered: priv.focusedAppDelegate.maximizeLeft()
78− active: priv.focusedAppDelegate !== null
81+ active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximizedLeftRight
81 GlobalShortcut {
84 GlobalShortcut {
82 id: maximizeWindowRightShortcut
85 id: maximizeWindowRightShortcut
83 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Right
86 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Right
84 onTriggered: priv.focusedAppDelegate.maximizeRight()
87 onTriggered: priv.focusedAppDelegate.maximizeRight()
85− active: priv.focusedAppDelegate !== null
88+ active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximizedLeftRight
88 GlobalShortcut {
91 GlobalShortcut {
89 id: minimizeRestoreShortcut
92 id: minimizeRestoreShortcut
90 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Down
93 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Down
91− onTriggered: priv.focusedAppDelegate.maximized || priv.focusedAppDelegate.maximizedLeft || priv.focusedAppDelegate.maximizedRight ||
94+ onTriggered: priv.focusedAppDelegate.anyMaximized
92− priv.focusedAppDelegate.maximizedHorizontally || priv.focusedAppDelegate.maximizedVertically
93 ? priv.focusedAppDelegate.restoreFromMaximized() : priv.focusedAppDelegate.minimize()
95 ? priv.focusedAppDelegate.restoreFromMaximized() : priv.focusedAppDelegate.minimize()
94 active: priv.focusedAppDelegate !== null
96 active: priv.focusedAppDelegate !== null
@@ -206,6 +208,12 @@ AbstractStage {
206 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
208 value: priv.focusedAppDelegate && priv.focusedAppDelegate.maximized && !priv.focusedAppDelegate.isDash
213+ property: "maximizedAppDelegate"
214+ value: priv.foregroundMaximizedAppDelegate ? priv.foregroundMaximizedAppDelegate : null
209 Component.onDestruction: {
217 Component.onDestruction: {
210 PanelState.title = "";
218 PanelState.title = "";
211 PanelState.buttonsVisible = false;
219 PanelState.buttonsVisible = false;
@@ -276,7 +284,7 @@ AbstractStage {
276 value: appDelegate.requestedY -
284 value: appDelegate.requestedY -
277 Math.min(appDelegate.requestedY - PanelState.panelHeight,
285 Math.min(appDelegate.requestedY - PanelState.panelHeight,
278 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
286 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
279− when: root.oskEnabled && appDelegate.focus && appDelegate.state == "normal"
287+ when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
280 && SurfaceManager.inputMethodSurface
288 && SurfaceManager.inputMethodSurface
281 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
289 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
282 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
290 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
@@ -291,7 +299,7 @@ AbstractStage {
291 onShellOrientationAngleChanged: {
299 onShellOrientationAngleChanged: {
292 // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle
300 // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle
293 if (application && application.rotatesWindowContents) {
301 if (application && application.rotatesWindowContents) {
294− if (state == "normal") {
302+ if (state == "normal" || state == "restored") {
295 var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;
303 var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;
296 angleDiff = (360 + angleDiff) % 360;
304 angleDiff = (360 + angleDiff) % 360;
297 if (angleDiff === 90 || angleDiff === 270) {
305 if (angleDiff === 90 || angleDiff === 270) {
@@ -317,14 +325,29 @@ AbstractStage {
317 property int requestedWidth: -1
325 property int requestedWidth: -1
318 property int requestedHeight: -1
326 property int requestedHeight: -1
320− readonly property bool maximized: windowState & WindowStateStorage.WindowStateMaximized
328+ readonly property bool maximized: windowState === WindowStateStorage.WindowStateMaximized
321− readonly property bool maximizedLeft: windowState & WindowStateStorage.WindowStateMaximizedLeft
329+ readonly property bool maximizedLeft: windowState === WindowStateStorage.WindowStateMaximizedLeft
322− readonly property bool maximizedRight: windowState & WindowStateStorage.WindowStateMaximizedRight
330+ readonly property bool maximizedRight: windowState === WindowStateStorage.WindowStateMaximizedRight
323− readonly property bool maximizedHorizontally: windowState & WindowStateStorage.WindowStateMaximizedHorizontally
331+ readonly property bool maximizedHorizontally: windowState === WindowStateStorage.WindowStateMaximizedHorizontally
324− readonly property bool maximizedVertically: windowState & WindowStateStorage.WindowStateMaximizedVertically
332+ readonly property bool maximizedVertically: windowState === WindowStateStorage.WindowStateMaximizedVertically
333+ readonly property bool maximizedTopLeft: windowState === WindowStateStorage.WindowStateMaximizedTopLeft
334+ readonly property bool maximizedTopRight: windowState === WindowStateStorage.WindowStateMaximizedTopRight
335+ readonly property bool maximizedBottomLeft: windowState === WindowStateStorage.WindowStateMaximizedBottomLeft
336+ readonly property bool maximizedBottomRight: windowState === WindowStateStorage.WindowStateMaximizedBottomRight
337+ readonly property bool anyMaximized: maximized || maximizedLeft || maximizedRight || maximizedHorizontally || maximizedVertically ||
338+ maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
325 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
340 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
326 readonly property alias fullscreen: decoratedWindow.fullscreen
341 readonly property alias fullscreen: decoratedWindow.fullscreen
343+ readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
344+ readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
345+ (maximumHeight == 0 || maximumHeight >= appContainer.height)
346+ readonly property bool canBeCornerMaximized: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
347+ (maximumHeight == 0 || maximumHeight >= appContainer.height/2)
348+ readonly property bool canBeMaximizedHorizontally: maximumWidth == 0 || maximumWidth >= appContainer.width
349+ readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height
328 property int windowState: WindowStateStorage.WindowStateNormal
351 property int windowState: WindowStateStorage.WindowStateNormal
329 property bool animationsEnabled: true
352 property bool animationsEnabled: true
330 property alias title: decoratedWindow.title
353 property alias title: decoratedWindow.title
@@ -335,6 +358,7 @@ AbstractStage {
335 readonly property var surface: model.surface
358 readonly property var surface: model.surface
336 readonly property alias resizeArea: resizeArea
359 readonly property alias resizeArea: resizeArea
337 readonly property alias focusedSurface: decoratedWindow.focusedSurface
360 readonly property alias focusedSurface: decoratedWindow.focusedSurface
361+ readonly property var moveHandler: touchControls.overlayShown ? touchControls.moveHandler : decoratedWindow.moveHandler
339 readonly property bool isDash: model.application.appId == "unity8-dash"
363 readonly property bool isDash: model.application.appId == "unity8-dash"
@@ -342,7 +366,7 @@ AbstractStage {
342 if (spread.state == "altTab") {
366 if (spread.state == "altTab") {
343 spread.cancel();
367 spread.cancel();
345− appDelegate.restore();
369+ appDelegate.restore(true /* animated */, appDelegate.windowState);
347 Connections {
371 Connections {
348 target: model.surface
372 target: model.surface
@@ -362,9 +386,6 @@ AbstractStage {
364 onFocusChanged: {
388 onFocusChanged: {
365− if (appRepeater.startingUp)
368 if (focus) {
389 if (focus) {
369 // If we're orphan (!parent) it means this stage is no longer the current one
390 // If we're orphan (!parent) it means this stage is no longer the current one
370 // and will be deleted shortly. So we should no longer have a say over the model
391 // and will be deleted shortly. So we should no longer have a say over the model
@@ -450,28 +471,34 @@ AbstractStage {
450 animationsEnabled = (animated === undefined) || animated;
471 animationsEnabled = (animated === undefined) || animated;
451 windowState = WindowStateStorage.WindowStateMaximizedVertically;
472 windowState = WindowStateStorage.WindowStateMaximizedVertically;
474+ function maximizeTopLeft(animated) {
475+ animationsEnabled = (animated === undefined) || animated;
476+ windowState = WindowStateStorage.WindowStateMaximizedTopLeft;
478+ function maximizeTopRight(animated) {
479+ animationsEnabled = (animated === undefined) || animated;
480+ windowState = WindowStateStorage.WindowStateMaximizedTopRight;
482+ function maximizeBottomLeft(animated) {
483+ animationsEnabled = (animated === undefined) || animated;
484+ windowState = WindowStateStorage.WindowStateMaximizedBottomLeft;
486+ function maximizeBottomRight(animated) {
487+ animationsEnabled = (animated === undefined) || animated;
488+ windowState = WindowStateStorage.WindowStateMaximizedBottomRight;
453 function minimize(animated) {
490 function minimize(animated) {
454 animationsEnabled = (animated === undefined) || animated;
491 animationsEnabled = (animated === undefined) || animated;
455 windowState |= WindowStateStorage.WindowStateMinimized; // add the minimized bit
492 windowState |= WindowStateStorage.WindowStateMinimized; // add the minimized bit
457 function restoreFromMaximized(animated) {
494 function restoreFromMaximized(animated) {
458 animationsEnabled = (animated === undefined) || animated;
495 animationsEnabled = (animated === undefined) || animated;
459− windowState = WindowStateStorage.WindowStateNormal;
496+ windowState = WindowStateStorage.WindowStateRestored;
461− function restore(animated) {
498+ function restore(animated,state) {
462 animationsEnabled = (animated === undefined) || animated;
499 animationsEnabled = (animated === undefined) || animated;
500+ windowState = state || WindowStateStorage.WindowStateRestored;
463 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
501 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
466− else if (maximizedLeft)
468− else if (maximizedRight)
470− else if (maximizedHorizontally)
471− maximizeHorizontally();
472− else if (maximizedVertically)
473− maximizeVertically();
475 focus = true;
502 focus = true;
@@ -488,9 +515,14 @@ AbstractStage {
488 duration: UbuntuAnimation.SnapDuration
515 duration: UbuntuAnimation.SnapDuration
518+ // unlike requestedX/Y, this is the last known grab position before being pushed against edges/corners
519+ // when restoring, the window should return to these, not to the place where it was dropped near the edge
520+ property real restoredX
521+ property real restoredY
491 states: [
523 states: [
493− name: "fullscreen"; when: decoratedWindow.fullscreen && !appDelegate.minimized
525+ name: "fullscreen"; when: appDelegate.fullscreen && !appDelegate.minimized
494 PropertyChanges {
526 PropertyChanges {
495 target: appDelegate;
527 target: appDelegate;
496 x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight)
528 x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight)
@@ -509,61 +541,94 @@ AbstractStage {
512− name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized
544+ name: "restored";
545+ when: appDelegate.windowState == WindowStateStorage.WindowStateRestored
513 PropertyChanges {
547 PropertyChanges {
514 target: appDelegate;
548 target: appDelegate;
515− x: root.leftMargin;
549+ requestedX: restoredX;
516− y: 0;
550+ requestedY: restoredY;
517− visuallyMinimized: false;
518− visuallyMaximized: true
554+ name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized
520 PropertyChanges {
555 PropertyChanges {
521− target: decoratedWindow
556+ target: appDelegate;
557+ requestedX: root.leftMargin;
522 requestedWidth: appContainer.width - root.leftMargin;
559 requestedWidth: appContainer.width - root.leftMargin;
523 requestedHeight: appContainer.height;
560 requestedHeight: appContainer.height;
561+ visuallyMinimized: false;
562+ visuallyMaximized: true
527 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
566 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
528 PropertyChanges {
567 PropertyChanges {
529 target: appDelegate
568 target: appDelegate
530− x: root.leftMargin
569+ requestedX: root.leftMargin
531− y: PanelState.panelHeight
570+ requestedY: PanelState.panelHeight
534− target: decoratedWindow
535 requestedWidth: (appContainer.width - root.leftMargin)/2
571 requestedWidth: (appContainer.width - root.leftMargin)/2
536 requestedHeight: appContainer.height - PanelState.panelHeight
572 requestedHeight: appContainer.height - PanelState.panelHeight
540 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
576 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
577+ extend: "maximizedLeft"
541 PropertyChanges {
578 PropertyChanges {
542 target: appDelegate;
579 target: appDelegate;
543− x: (appContainer.width + root.leftMargin)/2
580+ requestedX: (appContainer.width + root.leftMargin)/2
544− y: PanelState.panelHeight
584+ name: "maximizedTopLeft"; when: appDelegate.maximizedTopLeft && !appDelegate.minimized
546 PropertyChanges {
585 PropertyChanges {
547− target: decoratedWindow
586+ target: appDelegate
587+ requestedX: root.leftMargin
588+ requestedY: PanelState.panelHeight
548 requestedWidth: (appContainer.width - root.leftMargin)/2
589 requestedWidth: (appContainer.width - root.leftMargin)/2
549− requestedHeight: appContainer.height - PanelState.panelHeight
590+ requestedHeight: (appContainer.height - PanelState.panelHeight)/2
594+ name: "maximizedTopRight"; when: appDelegate.maximizedTopRight && !appDelegate.minimized
595+ extend: "maximizedTopLeft"
598+ requestedX: (appContainer.width + root.leftMargin)/2
602+ name: "maximizedBottomLeft"; when: appDelegate.maximizedBottomLeft && !appDelegate.minimized
605+ requestedX: root.leftMargin
606+ requestedY: (appContainer.height + PanelState.panelHeight)/2
607+ requestedWidth: (appContainer.width - root.leftMargin)/2
608+ requestedHeight: appContainer.height/2
612+ name: "maximizedBottomRight"; when: appDelegate.maximizedBottomRight && !appDelegate.minimized
613+ extend: "maximizedBottomLeft"
616+ requestedX: (appContainer.width + root.leftMargin)/2
553 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
620 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
554− PropertyChanges { target: appDelegate; x: root.leftMargin }
621+ PropertyChanges { target: appDelegate; requestedX: root.leftMargin; requestedY: requestedY; requestedWidth: appContainer.width - root.leftMargin }
555− PropertyChanges { target: decoratedWindow; requestedWidth: appContainer.width - root.leftMargin }
558 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
624 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
559− PropertyChanges { target: appDelegate; y: PanelState.panelHeight }
625+ PropertyChanges { target: appDelegate; requestedX: requestedX; requestedY: PanelState.panelHeight; requestedHeight: appContainer.height - PanelState.panelHeight }
560− PropertyChanges { target: decoratedWindow; requestedHeight: appContainer.height - PanelState.panelHeight }
563 name: "minimized"; when: appDelegate.minimized
628 name: "minimized"; when: appDelegate.minimized
564 PropertyChanges {
629 PropertyChanges {
565 target: appDelegate;
630 target: appDelegate;
566− x: -appDelegate.width / 2;
631+ requestedX: -appDelegate.width / 2;
567 scale: units.gu(5) / appDelegate.width;
632 scale: units.gu(5) / appDelegate.width;
568 opacity: 0;
633 opacity: 0;
569 visuallyMinimized: true;
634 visuallyMinimized: true;
@@ -573,21 +638,17 @@ AbstractStage {
574 transitions: [
639 transitions: [
575 Transition {
640 Transition {
576− to: "normal"
641+ to: "normal,restored"
577 enabled: appDelegate.animationsEnabled
642 enabled: appDelegate.animationsEnabled
578 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
643 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
579− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,requestedWidth,requestedHeight,scale"; duration: UbuntuAnimation.FastDuration }
644+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }
580− UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
582 Transition {
646 Transition {
583 to: "minimized"
647 to: "minimized"
584 enabled: appDelegate.animationsEnabled
648 enabled: appDelegate.animationsEnabled
585 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
649 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
586 SequentialAnimation {
650 SequentialAnimation {
588− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration }
651+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }
589− UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
591 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
652 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
592 ScriptAction {
653 ScriptAction {
593 script: {
654 script: {
@@ -604,11 +665,9 @@ AbstractStage {
604 enabled: appDelegate.animationsEnabled
665 enabled: appDelegate.animationsEnabled
605 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
666 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
606 SequentialAnimation {
667 SequentialAnimation {
608− UbuntuNumberAnimation { target: appDelegate; properties: "x,y,opacity,scale"; duration: UbuntuAnimation.FastDuration }
668+ UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }
609− UbuntuNumberAnimation { target: decoratedWindow; properties: "requestedWidth,requestedHeight"; duration: UbuntuAnimation.FastDuration }
611 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
669 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
670+ ScriptAction { script: { fakeRectangle.stop(); } }
@@ -674,27 +733,38 @@ AbstractStage {
674 surface: model.surface
733 surface: model.surface
675 active: appDelegate.focus
734 active: appDelegate.focus
676 focus: true
735 focus: true
677− maximizeButtonShown: (maximumWidth == 0 || maximumWidth >= appContainer.width) &&
736+ maximizeButtonShown: appDelegate.canBeMaximized
678− (maximumHeight == 0 || maximumHeight >= appContainer.height)
679 overlayShown: touchControls.overlayShown
737 overlayShown: touchControls.overlayShown
738+ stageWidth: appContainer.width
739+ stageHeight: appContainer.height
681 requestedWidth: appDelegate.requestedWidth
741 requestedWidth: appDelegate.requestedWidth
682 requestedHeight: appDelegate.requestedHeight
742 requestedHeight: appDelegate.requestedHeight
684 onCloseClicked: { appDelegate.close(); }
744 onCloseClicked: { appDelegate.close(); }
685− onMaximizeClicked: appDelegate.maximized || appDelegate.maximizedLeft || appDelegate.maximizedRight
686− || appDelegate.maximizedHorizontally || appDelegate.maximizedVertically
687− ? appDelegate.restoreFromMaximized() : appDelegate.maximize()
745+ onMaximizeClicked: appDelegate.anyMaximized ? appDelegate.restoreFromMaximized() : appDelegate.maximize();
688 onMaximizeHorizontallyClicked: appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()
746 onMaximizeHorizontallyClicked: appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()
689 onMaximizeVerticallyClicked: appDelegate.maximizedVertically ? appDelegate.restoreFromMaximized() : appDelegate.maximizeVertically()
747 onMaximizeVerticallyClicked: appDelegate.maximizedVertically ? appDelegate.restoreFromMaximized() : appDelegate.maximizeVertically()
690 onMinimizeClicked: appDelegate.minimize()
748 onMinimizeClicked: appDelegate.minimize()
691 onDecorationPressed: { appDelegate.focus = true; }
749 onDecorationPressed: { appDelegate.focus = true; }
750+ onShouldCommitSnapWindow: fakeRectangle.commit();
694 WindowControlsOverlay {
753 WindowControlsOverlay {
695 id: touchControls
754 id: touchControls
696− anchors.fill: appDelegate
697 target: appDelegate
755 target: appDelegate
756+ stageWidth: appContainer.width
757+ stageHeight: appContainer.height
759+ onFakeMaximizeAnimationRequested: if (!appDelegate.maximized) fakeRectangle.maximize(amount, true)
760+ onFakeMaximizeLeftAnimationRequested: if (!appDelegate.maximizedLeft) fakeRectangle.maximizeLeft(amount, true)
761+ onFakeMaximizeRightAnimationRequested: if (!appDelegate.maximizedRight) fakeRectangle.maximizeRight(amount, true)
762+ onFakeMaximizeTopLeftAnimationRequested: if (!appDelegate.maximizedTopLeft) fakeRectangle.maximizeTopLeft(amount, true);
763+ onFakeMaximizeTopRightAnimationRequested: if (!appDelegate.maximizedTopRight) fakeRectangle.maximizeTopRight(amount, true);
764+ onFakeMaximizeBottomLeftAnimationRequested: if (!appDelegate.maximizedBottomLeft) fakeRectangle.maximizeBottomLeft(amount, true);
765+ onFakeMaximizeBottomRightAnimationRequested: if (!appDelegate.maximizedBottomRight) fakeRectangle.maximizeBottomRight(amount, true);
766+ onStopFakeAnimation: fakeRectangle.stop();
767+ onShouldCommitSnapWindow: fakeRectangle.commit();
700 WindowedFullscreenPolicy {
770 WindowedFullscreenPolicy {
@@ -706,6 +776,14 @@ AbstractStage {
779+ FakeMaximizeDelegate {
781+ target: priv.focusedAppDelegate
782+ leftMargin: root.leftMargin
783+ appContainerWidth: appContainer.width
784+ appContainerHeight: appContainer.height
709 EdgeBarrier {
787 EdgeBarrier {
710 id: edgeBarrier
788 id: edgeBarrier