on xenial help sign in
simplify
4b9dc75Lukáš Tinkl
qml/Stage/Stage.qml+5−10
@@ -949,15 +949,10 @@ FocusScope {
949 readonly property bool windowReady: clientAreaItem.surfaceInitialized
949 readonly property bool windowReady: clientAreaItem.surfaceInitialized
950 property int requestedWindowState: Mir.RestoredState
950 property int requestedWindowState: Mir.RestoredState
951 onWindowReadyChanged: {
951 onWindowReadyChanged: {
952− if (windowReady) {
953− // Now load any saved state. This needs to happen *after* the cascading!
954− if (root.mode == "windowed") {
952+ if (windowReady && root.mode == "windowed") {
955− var ws = requestedWindowState;
956−
957− // need to apply the windowed shell chrome policy on top the saved window state
953+ // need to apply the windowed shell chrome policy on top the saved window state
958− ws = windowedFullscreenPolicy.applyPolicy(ws, surface.shellChrome);
954+ requestedWindowState = windowedFullscreenPolicy.applyPolicy(requestedWindowState, surface.shellChrome);
959− window.requestState(ws);
955+ window.requestState(requestedWindowState);
960− }
961 }
956 }
962 }
957 }
963
958
@@ -971,7 +966,7 @@ FocusScope {
971 // First, cascade the newly created window, relative to the currently/old focused window.
966 // First, cascade the newly created window, relative to the currently/old focused window.
972 windowedX = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedX + units.gu(3) : (normalZ - 1) * units.gu(3)
967 windowedX = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedX + units.gu(3) : (normalZ - 1) * units.gu(3)
973 windowedY = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedY + units.gu(3) : normalZ * units.gu(3)
968 windowedY = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedY + units.gu(3) : normalZ * units.gu(3)
974−
969+ // Now load any saved state. This needs to happen *after* the cascading!
975 requestedWindowState = WindowStateStorage.toMirState(windowStateSaver.load());
970 requestedWindowState = WindowStateStorage.toMirState(windowStateSaver.load());
976
971
977 updateQmlFocusFromMirSurfaceFocus();
972 updateQmlFocusFromMirSurfaceFocus();