on xenial help sign in
Fix handling of fullscreen on ARM
9cb3100Dalton Durst
qml/Shell.qml+1−1
@@ -552,7 +552,7 @@ StyledItem {
552 }
552 }
553
553
554 readonly property bool focusedSurfaceIsFullscreen: topLevelSurfaceList.focusedWindow
554 readonly property bool focusedSurfaceIsFullscreen: topLevelSurfaceList.focusedWindow
555− ? topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState
555+ ? topLevelSurfaceList.focusedWindow.state == Mir.FullscreenState
556 : false
556 : false
557 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0 && !stage.spreadShown)
557 fullscreenMode: (focusedSurfaceIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0 && !stage.spreadShown)
558 || greeter.hasLockedApp
558 || greeter.hasLockedApp
qml/Stage/TabletStage.qml+1−1
@@ -775,7 +775,7 @@ AbstractStage {
775 if (priv.mainStageDelegate && stage === ApplicationInfoInterface.SideStage) {
775 if (priv.mainStageDelegate && stage === ApplicationInfoInterface.SideStage) {
776 return priv.mainStageDelegate.fullscreen;
776 return priv.mainStageDelegate.fullscreen;
777 } else if (surface) {
777 } else if (surface) {
778− return surface.state === Mir.FullscreenState;
778+ return surface.state == Mir.FullscreenState;
779 } else if (application) {
779 } else if (application) {
780 return application.fullscreen;
780 return application.fullscreen;
781 } else {
781 } else {
qml/Stage/WindowedFullscreenPolicy.qml+1−1
@@ -23,7 +23,7 @@ import Unity.Application 0.1
23// state of the window is returned to restored.
23// state of the window is returned to restored.
24QtObject {
24QtObject {
25 function applyPolicy(surfaceState, surfaceChrome) {
25 function applyPolicy(surfaceState, surfaceChrome) {
26− if (surfaceState === Mir.FullscreenState && surfaceChrome === Mir.LowChrome) {
26+ if (surfaceState == Mir.FullscreenState && surfaceChrome === Mir.LowChrome) {
27 return Mir.RestoredState;
27 return Mir.RestoredState;
28 }
28 }
29 return surfaceState;
29 return surfaceState;
tests/mocks/Unity/Application/ApplicationInfo.cpp+7−1
@@ -268,7 +268,13 @@ void ApplicationInfo::setFullscreen(bool value)
268{
268{
269 m_fullscreen = value;
269 m_fullscreen = value;
270 if (m_surfaceList->rowCount() > 0) {
270 if (m_surfaceList->rowCount() > 0) {
271+ Mir::State newState;
272+ if (value) {
273+ newState = Mir::FullscreenState;
274+ } else {
275+ newState = Mir::RestoredState;
276+ }
271− m_surfaceList->get(0)->requestState(Mir::FullscreenState);
277+ m_surfaceList->get(0)->requestState(newState);
272 }
278 }
273}
279}
274
280
tests/mocks/Unity/Application/ApplicationInfo.h+2−6
@@ -36,15 +36,11 @@ using namespace unity::shell::application;
36class ApplicationInfo : public ApplicationInfoInterface {
36class ApplicationInfo : public ApplicationInfoInterface {
37 Q_OBJECT
37 Q_OBJECT
38
38
39− ////
40− // FIXME: Remove those
41− Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged)
42−
43− // Only exists in this fake implementation
44−
45 // whether the test code will explicitly control the creation of the application surface
39 // whether the test code will explicitly control the creation of the application surface
40+ // Only exists in this mock
46 Q_PROPERTY(bool manualSurfaceCreation READ manualSurfaceCreation WRITE setManualSurfaceCreation NOTIFY manualSurfaceCreationChanged)
41 Q_PROPERTY(bool manualSurfaceCreation READ manualSurfaceCreation WRITE setManualSurfaceCreation NOTIFY manualSurfaceCreationChanged)
47
42
43+ // Only exists in this mock
48 Q_PROPERTY(QString screenshot READ screenshot CONSTANT)
44 Q_PROPERTY(QString screenshot READ screenshot CONSTANT)
49
45
50public:
46public:
tests/qmltests/tst_OrientedShell.qml+5−6
@@ -649,18 +649,17 @@ Rectangle {
649 var cameraSurfaceId = topLevelSurfaceList.nextId;
649 var cameraSurfaceId = topLevelSurfaceList.nextId;
650 var cameraApp = ApplicationManager.startApplication("camera-app");
650 var cameraApp = ApplicationManager.startApplication("camera-app");
651 verify(cameraApp);
651 verify(cameraApp);
652+ tryVerify(function() {return cameraApp.surfaceList.get(0)});
653+ var cameraSurface = cameraApp.surfaceList.get(0);
652
654
653 // ensure the mock camera-app is as we expect
655 // ensure the mock camera-app is as we expect
654− compare(cameraApp.fullscreen, true);
656+ tryCompare(cameraSurface, "state", Mir.FullscreenState, 1000);
655 compare(cameraApp.rotatesWindowContents, true);
657 compare(cameraApp.rotatesWindowContents, true);
656 compare(cameraApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
658 compare(cameraApp.supportedOrientations, Qt.PortraitOrientation | Qt.LandscapeOrientation
657 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
659 | Qt.InvertedPortraitOrientation | Qt.InvertedLandscapeOrientation);
658
660
659 waitUntilAppWindowIsFullyLoaded(cameraSurfaceId);
661 waitUntilAppWindowIsFullyLoaded(cameraSurfaceId);
660
662
661− var cameraSurface = cameraApp.surfaceList.get(0);
662− verify(cameraSurface);
663−
664 var focusChangedSpy = signalSpy;
663 var focusChangedSpy = signalSpy;
665 focusChangedSpy.clear();
664 focusChangedSpy.clear();
666 focusChangedSpy.target = cameraSurface;
665 focusChangedSpy.target = cameraSurface;
@@ -697,8 +696,8 @@ Rectangle {
697
696
698 if (!data.windowed) { // subject to shell-chrome policies
697 if (!data.windowed) { // subject to shell-chrome policies
699 // It should retain native dimensions regardless of its rotation/orientation
698 // It should retain native dimensions regardless of its rotation/orientation
700− compare(cameraSurface.width, orientedShell.width);
699+ tryCompare(cameraSurface, "width", orientedShell.width);
701− compare(cameraSurface.height, orientedShell.height);
700+ tryCompare(cameraSurface, "height", orientedShell.height);
702 }
701 }
703
702
704 // Surface focus shouldn't have been touched because of the rotation
703 // Surface focus shouldn't have been touched because of the rotation
tests/qmltests/tst_Shell.qml+1−1
@@ -349,7 +349,7 @@ Rectangle {
349 target: fullscreenAppCheck
349 target: fullscreenAppCheck
350 when: topLevelSurfaceList && topLevelSurfaceList.focusedWindow
350 when: topLevelSurfaceList && topLevelSurfaceList.focusedWindow
351 property: "checked"
351 property: "checked"
352− value: topLevelSurfaceList.focusedWindow.state === Mir.FullscreenState
352+ value: topLevelSurfaceList.focusedWindow.state == Mir.FullscreenState
353 }
353 }
354 }
354 }
355 Label {
355 Label {