on xenial help sign in
fix restoring fullscreen windows
d734438Lukáš Tinkl
qml/Stage/Stage.qml+11−2
@@ -806,7 +806,7 @@ FocusScope {
806 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
806 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
807
807
808 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
808 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
809− readonly property bool fullscreen: window.state === Mir.FullscreenState
809+ readonly property bool fullscreen: windowState === WindowStateStorage.WindowStateFullscreen
810
810
811 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
811 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
812 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
812 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
@@ -818,6 +818,7 @@ FocusScope {
818 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled
818 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled
819
819
820 property int windowState: WindowStateStorage.WindowStateNormal
820 property int windowState: WindowStateStorage.WindowStateNormal
821+ property int prevWindowState: WindowStateStorage.WindowStateRestored
821 property bool animationsEnabled: true
822 property bool animationsEnabled: true
822 property alias title: decoratedWindow.title
823 property alias title: decoratedWindow.title
823 readonly property string appName: model.application ? model.application.name : ""
824 readonly property string appName: model.application ? model.application.name : ""
@@ -922,7 +923,14 @@ FocusScope {
922 } else if (model.window.state === Mir.MaximizedBottomRightState) {
923 } else if (model.window.state === Mir.MaximizedBottomRightState) {
923 appDelegate.maximizeBottomRight();
924 appDelegate.maximizeBottomRight();
924 } else if (model.window.state === Mir.RestoredState) {
925 } else if (model.window.state === Mir.RestoredState) {
926+ if (appDelegate.fullscreen && appDelegate.prevWindowState != WindowStateStorage.WindowStateRestored) {
927+ model.window.requestState(WindowStateStorage.toMirState(appDelegate.prevWindowState));
928+ } else {
925− appDelegate.restore();
929+ appDelegate.restore();
930+ }
931+ } else if (model.window.state === Mir.FullscreenState) {
932+ appDelegate.prevWindowState = appDelegate.windowState;
933+ appDelegate.windowState = WindowStateStorage.WindowStateFullscreen;
926 }
934 }
927 }
935 }
928 }
936 }
@@ -1024,6 +1032,7 @@ FocusScope {
1024 animationsEnabled = (animated === undefined) || animated;
1032 animationsEnabled = (animated === undefined) || animated;
1025 windowState = state || WindowStateStorage.WindowStateRestored;
1033 windowState = state || WindowStateStorage.WindowStateRestored;
1026 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
1034 windowState &= ~WindowStateStorage.WindowStateMinimized; // clear the minimized bit
1035+ prevWindowState = windowState;
1027 }
1036 }
1028
1037
1029 function playFocusAnimation() {
1038 function playFocusAnimation() {
tests/mocks/Unity/Application/SurfaceManager.cpp−2
@@ -204,8 +204,6 @@ void SurfaceManager::activate(unityapi::MirSurfaceInterface *apiSurface)
204
204
205void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state)
205void SurfaceManager::onStateRequested(MirSurface *surface, Mir::State state)
206{
206{
207− Q_ASSERT(!m_underModification);
208−
209 DEBUG_MSG("("<<surface<<","<<state<<") started");
207 DEBUG_MSG("("<<surface<<","<<state<<") started");
210 Q_EMIT modificationsStarted();
208 Q_EMIT modificationsStarted();
211 m_underModification = true;
209 m_underModification = true;
tests/qmltests/tst_Shell.qml+2
@@ -335,6 +335,8 @@ Rectangle {
335 Row {
335 Row {
336 CheckBox {
336 CheckBox {
337 id: fullscreeAppCheck
337 id: fullscreeAppCheck
338+ activeFocusOnPress: false
339+ activeFocusOnTab: false
338
340
339 onTriggered: {
341 onTriggered: {
340 if (!topLevelSurfaceList.focusedWindow) return;
342 if (!topLevelSurfaceList.focusedWindow) return;