@@ -467,12 +467,6 @@ AbstractStage {
467467 value: ApplicationManager.count + 1
468468 when: index == spread.highlightedIndex && blurLayer.ready
469469 }
470− Binding {
471− target: root
472− when: index == 0
473− property: "mainAppWindowIsFullscreen"
474− value: decoratedWindow.fullscreen
475− }
476470
477471 WindowResizeArea {
478472 id: resizeArea
@@ -490,9 +484,10 @@ AbstractStage {
490484 property bool saveStateOnDestruction: true
491485 Connections {
492486 target: root
493− onSaveWindowState: {
487+ onStageUnloaded: {
494488 resizeArea.saveWindowState();
495489 resizeArea.saveStateOnDestruction = false;
490+ fullscreenPolicy.active = false;
496491 }
497492 }
498493 Component.onDestruction: {
@@ -510,7 +505,6 @@ AbstractStage {
510505 application: ApplicationManager.get(index)
511506 active: ApplicationManager.focusedApplicationId === model.appId
512507 focus: true
513− fullscreen: application.fullscreen
514508
515509 requestedWidth: appDelegate.requestedWidth
516510 requestedHeight: appDelegate.requestedHeight
@@ -522,18 +516,10 @@ AbstractStage {
522516 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
523517 }
524518
525− property bool firstTimeSurface: true
526− property var lastSurface: decoratedWindow.application && decoratedWindow.application.session ?
527− decoratedWindow.application.session.lastSurface : null
528− onLastSurfaceChanged: {
529− if (!lastSurface) return;
530− if (!firstTimeSurface) return;
531− firstTimeSurface = false;
532−
533− if (lastSurface.state === Mir.FullscreenState &&
534− lastSurface.shellChrome === Mir.LowChrome) {
535− lastSurface.state = Mir.RestoredState;
536− }
519+ DesktopFullscreenPolicy {
520+ id: fullscreenPolicy
521+ active: true
522+ application: decoratedWindow.application
537523 }
538524 }
539525 }