@@ -268,14 +268,37 @@ AbstractStage {
268268
269269 width: decoratedWindow.width
270270 height: decoratedWindow.height
271+
272+ Connections {
273+ target: root
274+ onShellOrientationAngleChanged: {
275+ // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle
276+ if (application && application.rotatesWindowContents) {
277+ if (state == "normal") {
278+ var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;
279+ angleDiff = (360 + angleDiff) % 360;
280+ if (angleDiff === 90 || angleDiff === 270) {
281+ var aux = decoratedWindow.requestedHeight;
282+ decoratedWindow.requestedHeight = decoratedWindow.requestedWidth + decoratedWindow.visibleDecorationHeight;
283+ decoratedWindow.requestedWidth = aux - decoratedWindow.visibleDecorationHeight;
284+ }
285+ }
286+ decoratedWindow.surfaceOrientationAngle = shellOrientationAngle;
287+ } else {
288+ decoratedWindow.surfaceOrientationAngle = 0;
289+ }
290+ }
291+ }
292+
293+ readonly property alias application: decoratedWindow.application
294+ readonly property alias minimumWidth: decoratedWindow.minimumWidth
295+ readonly property alias minimumHeight: decoratedWindow.minimumHeight
296+ readonly property alias maximumWidth: decoratedWindow.maximumWidth
297+ readonly property alias maximumHeight: decoratedWindow.maximumHeight
298+ readonly property alias widthIncrement: decoratedWindow.widthIncrement
299+ readonly property alias heightIncrement: decoratedWindow.heightIncrement
271300 property int requestedWidth: -1
272301 property int requestedHeight: -1
273− property alias minimumWidth: decoratedWindow.minimumWidth
274− property alias minimumHeight: decoratedWindow.minimumHeight
275− property alias maximumWidth: decoratedWindow.maximumWidth
276− property alias maximumHeight: decoratedWindow.maximumHeight
277− property alias widthIncrement: decoratedWindow.widthIncrement
278− property alias heightIncrement: decoratedWindow.heightIncrement
279302
280303 readonly property bool maximized: windowState & WindowStateStorage.WindowStateMaximized
281304 readonly property bool maximizedLeft: windowState & WindowStateStorage.WindowStateMaximizedLeft
@@ -286,8 +309,6 @@ AbstractStage {
286309 readonly property alias fullscreen: decoratedWindow.fullscreen
287310
288311 property int windowState: WindowStateStorage.WindowStateNormal
289−
290− readonly property var application: model.application
291312 property bool animationsEnabled: true
292313 property alias title: decoratedWindow.title
293314 readonly property string appName: model.application ? model.application.name : ""
@@ -338,6 +359,12 @@ AbstractStage {
338359 }
339360 }
340361 Component.onCompleted: {
362+ if (application && application.rotatesWindowContents) {
363+ decoratedWindow.surfaceOrientationAngle = shellOrientationAngle;
364+ } else {
365+ decoratedWindow.surfaceOrientationAngle = 0;
366+ }
367+
341368 // NB: We're differentiating if this delegate was created in response to a new entry in the model
342369 // or if the Repeater is just populating itself with delegates to match the model it received.
343370 if (!appRepeater.startingUp) {
@@ -445,8 +472,8 @@ AbstractStage {
445472 name: "fullscreen"; when: decoratedWindow.fullscreen && !appDelegate.minimized
446473 PropertyChanges {
447474 target: appDelegate;
448− x: 0;
449− y: -PanelState.panelHeight
475+ x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight)
476+ y: rotation == 0 ? -PanelState.panelHeight : (parent.height - height) / 2
450477 requestedWidth: appContainer.width;
451478 requestedHeight: appContainer.height;
452479 }