@@ -101,6 +101,8 @@ FocusScope {
101 // No we didn't, do a quick alt-tab
101 // No we didn't, do a quick alt-tab
102 if (appRepeater.count > 1) {
102 if (appRepeater.count > 1) {
103 appRepeater.itemAt(1).activate();
103 appRepeater.itemAt(1).activate();
104+ } else if (appRepeater.count > 0) {
105+ appRepeater.itemAt(0).activate(); // quick alt-tab to the only (minimized) window should still activate it
@@ -811,7 +813,7 @@ FocusScope {
811 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
813 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
813 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
815 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
814− readonly property bool fullscreen: window.state === Mir.FullscreenState
816+ readonly property bool fullscreen: windowState === WindowStateStorage.WindowStateFullscreen
816 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
818 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
817 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
819 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
@@ -822,7 +824,10 @@ FocusScope {
822 readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height
824 readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height
823 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled
825 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled
827+ // TODO drop our own windowType once Mir/Miral/Qtmir gets in sync with ours
825 property int windowState: WindowStateStorage.WindowStateNormal
828 property int windowState: WindowStateStorage.WindowStateNormal
829+ property int prevWindowState: WindowStateStorage.WindowStateRestored
826 property bool animationsEnabled: true
831 property bool animationsEnabled: true
827 property alias title: decoratedWindow.title
832 property alias title: decoratedWindow.title
828 readonly property string appName: model.application ? model.application.name : ""
833 readonly property string appName: model.application ? model.application.name : ""
@@ -877,9 +882,6 @@ FocusScope {
878 priv.updateMainAndSideStageIndexes();
883 priv.updateMainAndSideStageIndexes();
880− if (root.mode == "windowed") {
881− appDelegate.restore(true /* animated */, appDelegate.windowState);
883 appDelegate.focus = true;
885 appDelegate.focus = true;
@@ -929,7 +931,14 @@ FocusScope {
929 } else if (model.window.state === Mir.MaximizedBottomRightState) {
931 } else if (model.window.state === Mir.MaximizedBottomRightState) {
930 appDelegate.maximizeBottomRight();
932 appDelegate.maximizeBottomRight();
931 } else if (model.window.state === Mir.RestoredState) {
933 } else if (model.window.state === Mir.RestoredState) {
934+ if (appDelegate.fullscreen && appDelegate.prevWindowState != WindowStateStorage.WindowStateRestored) {
935+ model.window.requestState(WindowStateStorage.toMirState(appDelegate.prevWindowState));
932− appDelegate.restore();
937+ appDelegate.restore();
939+ } else if (model.window.state === Mir.FullscreenState) {
940+ appDelegate.prevWindowState = appDelegate.windowState;
941+ appDelegate.windowState = WindowStateStorage.WindowStateFullscreen;
@@ -1031,6 +1040,7 @@ FocusScope {
1031 animationsEnabled = (animated === undefined) || animated;
1040 animationsEnabled = (animated === undefined) || animated;
1032 windowState = state || WindowStateStorage.WindowStateRestored;
1041 windowState = state || WindowStateStorage.WindowStateRestored;
1033 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
1042 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
1043+ prevWindowState = windowState;
1036 function playFocusAnimation() {
1046 function playFocusAnimation() {