Merge lp:~mzanetti/unity8/unified-stages into lp:unity8

Proposed by Michael Zanetti
Status: Superseded
Proposed branch: lp:~mzanetti/unity8/unified-stages
Merge into: lp:unity8
Prerequisite: lp:~ci-train-bot/unity8/unity8-ubuntu-yakkety-landing-078
Diff against target: 12298 lines (+3465/-6154)
62 files modified
debian/changelog (+5/-3)
debian/unity8.install (+1/-1)
plugins/Ubuntu/Gestures/TouchGate.cpp (+4/-1)
plugins/WindowManager/TopLevelSurfaceList.cpp (+0/-5)
qml/CMakeLists.txt (+1/-1)
qml/Components/EdgeBarrier.qml (+2/-0)
qml/Components/FloatingFlickable.qml (+3/-0)
qml/Greeter/LoginAreaContainer.qml (+1/-1)
qml/Notifications/Notification.qml (+1/-1)
qml/Rotation/RotationStates.qml (+0/-6)
qml/Shell.qml (+54/-167)
qml/Stage/ApplicationWindow.qml (+13/-37)
qml/Stage/DecoratedWindow.qml (+111/-31)
qml/Stage/MoveHandler.qml (+2/-2)
qml/Stage/PromptSurfaceAnimations.qml (+2/-3)
qml/Stage/Spread/BezierCurve.qml (+45/-0)
qml/Stage/Spread/KeySpline.js (+66/-0)
qml/Stage/Spread/MathUtils.js (+95/-0)
qml/Stage/Spread/OpacityMask.qml (+82/-0)
qml/Stage/Spread/Spread.qml (+162/-0)
qml/Stage/Spread/SpreadDelegateInputArea.qml (+183/-0)
qml/Stage/Spread/SpreadMaths.qml (+78/-0)
qml/Stage/Spread/StagedRightEdgeMaths.qml (+174/-0)
qml/Stage/Spread/WindowedRightEdgeMaths.qml (+81/-0)
qml/Stage/Spread/cubic-bezier.js (+39/-0)
qml/Stage/Stage.qml (+1235/-185)
qml/Stage/StageMaths.qml (+79/-0)
qml/Stage/SurfaceContainer.qml (+5/-52)
qml/Stage/TopLevelSurfaceRepeater.qml (+9/-0)
qml/Stage/WindowDecoration.qml (+1/-1)
qml/Stage/WindowInfoItem.qml (+53/-0)
qml/Stage/WindowResizeArea.qml (+33/-32)
qml/Stages/AbstractStage.qml (+0/-93)
qml/Stages/DesktopSpread.qml (+0/-576)
qml/Stages/DesktopSpreadDelegate.qml (+0/-126)
qml/Stages/PhoneStage.qml (+0/-806)
qml/Stages/SpreadDelegate.qml (+0/-424)
qml/Stages/SpreadMaths.qml (+0/-164)
qml/Stages/TabletStage.qml (+0/-1201)
qml/Stages/TransformedSpreadDelegate.qml (+0/-391)
qml/Stages/TransformedTabletSpreadDelegate.qml (+0/-437)
qml/Tutorial/TutorialRight.qml (+1/-1)
tests/mocks/Unity/Application/ApplicationInfo.cpp (+2/-2)
tests/mocks/Unity/Application/ApplicationManager.cpp (+2/-0)
tests/mocks/Unity/Application/MirSurface.cpp (+1/-0)
tests/mocks/Unity/Application/MirSurfaceItem.cpp (+13/-0)
tests/mocks/Unity/Application/MirSurfaceListModel.cpp (+0/-1)
tests/mocks/Unity/Application/VirtualKeyboard.cpp (+9/-7)
tests/mocks/Unity/Application/resources/MirSurfaceItem.qml (+2/-5)
tests/qmltests/CMakeLists.txt (+8/-8)
tests/qmltests/Stage/tst_ApplicationWindow.qml (+1/-1)
tests/qmltests/Stage/tst_DecoratedWindow.qml (+232/-0)
tests/qmltests/Stage/tst_DesktopStage.qml (+29/-71)
tests/qmltests/Stage/tst_PhoneStage.qml (+152/-219)
tests/qmltests/Stage/tst_Splash.qml (+1/-1)
tests/qmltests/Stage/tst_SurfaceContainer.qml (+2/-2)
tests/qmltests/Stage/tst_TabletStage.qml (+104/-241)
tests/qmltests/Stage/tst_WindowResizeArea.qml (+40/-36)
tests/qmltests/Stages/tst_SpreadDelegate.qml (+0/-423)
tests/qmltests/tst_OrientedShell.qml (+38/-198)
tests/qmltests/tst_Shell.qml (+199/-180)
tests/qmltests/tst_ShellWithPin.qml (+9/-11)
To merge this branch: bzr merge lp:~mzanetti/unity8/unified-stages
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Lukáš Tinkl (community) Needs Fixing
Daniel d'Andrada (community) Approve
Review via email: mp+305588@code.launchpad.net

This proposal has been superseded by a proposal from 2016-10-05.

Commit message

Merge all Stages into one single codebase. Apply new spread visuals.

This deletes PhoneStage, TabletStage and DesktopStage, and merges all of the functionality into Stage. Also the spread visuals have been updated by design to work with all usage modes.

Description of the change

Also, you want this in order to fix a bug if an application is rotated while suspended (this can happen now as we can rotate while in the spread with the new visuals)
https://code.launchpad.net/~mzanetti/qtmir/resize-suspended/+merge/306500

* tested on turbo, frieza and desktop
* tested/verfied by design. There will be some follow up work, especially when it comes to the tablet usage mode but design is ok with landing this as intermediate step.
* no packaging change

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2544
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2207/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2896
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1588
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1588
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1588
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2924
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2782/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2782
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2782/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2207/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2549
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2212/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2911
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1600
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1600
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1600
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2939
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2797/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2212/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2557
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2218/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2918
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1602
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1602
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1602
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2946
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2804/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2804
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2804/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2218/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2558
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2219/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2919
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1603
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1603
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1603
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2947
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2805/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2805
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2805/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2219/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2559
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2220/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2921
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1605
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1605
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1605
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2949
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2807/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2807
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2807/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2220/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2560
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2223/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2924/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2952
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2810/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2810/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2810/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2810/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2810/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2810/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2810/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2810/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2810
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2810/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2223/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2561
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2224/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2928
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1609
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1609
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1609
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2956
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2814/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2814
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2814/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2224/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2561
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2225/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2929
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1610
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1610
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1610
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2957
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2815/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2815
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2815/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2225/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2562
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2226/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2930
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1611
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1611
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1611
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2958
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2816/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2816
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2816/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2226/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

There's a debug leftover in qml/Launcher/Launcher.qml

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Likewise in qml/Notifications/NotificationMenuItemFactory.qml

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

"""
// TODO: Is this still needed? Didn't come across it. Needs checking before merging
beingResized: shell.beingResized
"""

If you solved the <FIXME-contentX> that PhoneStage and TabletStage had, there should be no use for this anymore.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

In qml/Stage/DecoratedWindow.qml:

"""
// The DecoratedWindow takes requestedWidth/requestedHeight and asks it's surface to be resized to that
"""

Typo: s/it's/its

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

As far as I remember, ApplicationWindow.fullscreen had a single purpose left: ensure that a fullscreen application, when killed by the OutOfMemory daemon, retained its size instead of switching to a normal/restored size (ie, screen size minus the status bar). In phone mode particularly. That information came from qtmir's Application.fullscreen, which retained the state from its last surface.

But that property sure is (or was) tainting the API.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2563
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2227/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2931
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1612
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1612
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1612
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2959
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2817/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2817
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2817/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2227/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

In

"""
    property bool hasDecoration: true
"""

What about s/hasDecoration/decorated
Would sound more like a QML property

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

qml/Stage/Stage.qml

"""
    // Congifuration
    property string mode: "staged"
"""

Typo in comment.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

In qml/Stage/Stage.qml

"""
    // functions to be called from outside
[...]
    function closeFocusedDelegate() {
"""

Don't see closeFocusedDelegate() being called from outside. Could it be moved to the priv object? Or maybe even moved into closeFocusedShortcut as it's only used there and it's a quite small function.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

In qml/Stage/Stage.qml:

"""
        readonly property real virtualKeyboardHeight: SurfaceManager.inputMethodSurface
                                                          ? SurfaceManager.inputMethodSurface.inputBounds.height
                                                          : 0
"""

Please get it from outside. Let Shell wire it to inputMethod.visibleRect.height

"""
                    when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
                          && SurfaceManager.inputMethodSurface
                          && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
                          && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
""""

Likewise, all these SurfaceManager expressions could be supplied by inputMethod.visible from Shell.qml

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

"""
                readonly property bool fullscreen: surface && surface.state === Mir.FullscreenState;
"""

If there's no surface I think you will want to fallback to application.fullscreen as I explained in a previous comment.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2563
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2228/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2932
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1613
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1613
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1613
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2960
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2818/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2818
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2818/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2228/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> In
>
> """
> property bool hasDecoration: true
> """
>
> What about s/hasDecoration/decorated
> Would sound more like a QML property

in general, yes, I'd agree. Thing here is that there are 2, hasDecoration and showDecoration. toggling hasDecoration will resize the surface, while showDecoration will temporarily hide the decoration without actually resizing the surface. naming the property just "decorated" will blur the meaning between those too much IMO.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2567
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2229/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2933
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1614
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1614
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1614
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2961
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2819/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2819
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2819/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2229/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> """
> readonly property bool fullscreen: surface && surface.state
> === Mir.FullscreenState;
> """
>
> If there's no surface I think you will want to fallback to
> application.fullscreen as I explained in a previous comment.

I investigated now a while into this. I've tried:

readonly property bool fullscreen surface ? surface.state === Mir.FullscreenState : model.application.fullscreen

but this doesn't seem to reflect the correct thing in my tests... What I could do is something like:

property bool fullscreen: false
Connections { target: surface; onStateChanged: fullscreen = surface.state === Mir.FullscreenState }

This would work as expected, although being a tad ugly. The next thing though is that the panel doesn't use this logic, instead only acts on SurfaceManager.focusedSurface and in case we focus a OOM-killed item, it will go to fale and thus showing the panel on top of the otherwise fullscreen app. Not really sure what to do atm... opinions?

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2570
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2232/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2937
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1617
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1617
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1617
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2965
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2823/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2823
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2823/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2232/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Ok, I addressed all of Daniel's comments. I am falling back to application.fullscreen now, although it doesn't seem to behave as suggested by Daniel, nevertheless it shouldn't be worse than current trunk now.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2572
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2233/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2938
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1618
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1618
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1618
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2966
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2824/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2824
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2824/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2233/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Switching between apps, where one supports only one orientation:
https://youtu.be/mlodwKPUdyA

review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

qml/Stage/Stage.qml:67: TypeError: Cannot read property 'orientationChangesEnabled' of null

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2576
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2236/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2944
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1623
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1623
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1623
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2972
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2830/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2830
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2830/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2236/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

physical orientation is portrait while showing a landscape-only app. Go to spread and select that same app again, returning to the same state you were before:
https://youtu.be/kFr1xRCvQBU

That landscape-only app gets several resizes during that use case, going even to a portrait size in between:

MirSurface[0x29562f0,"Weathers window title"]::resize width=781 height=748
MirSurface[0x29562f0,"Weathers window title"]::resize width=440 height=748
MirSurface[0x29562f0,"Weathers window title"]::resize width=781 height=748
MirSurface[0x29562f0,"Weathers window title"]::resize width=781 height=407

Is all this really necessary to implement the new design?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Again on phone mode:
-Launch a landscape-only app
-rotate phone to portrait
-go to switcher and select a portrait-capable app like dash

The landscape-only app is left in a portrait size.

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2577
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2237/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2946
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1625
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1625
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1625
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2974
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2832/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2237/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

qml/Stage/OrientationChangeAnimation.qml was used by the old SpreadDelegate to do in-delegate AppWindow rotations. Happened when, in phone mode, you switched to an app that was in a orientation different than shell's current one. It would then rotate itself to match once in foreground.

If in the new world, all applications are always matching shell orientation, then this code won't be needed anymore and should be deleted (it's already dead code in this branch).

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

In Stage.qml:

+// property int animationDuration: 4000

This can be dropped probably?

review: Needs Information
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

In tests/mocks/Unity/Application/MirSurfaceListModel.cpp:

+// connect(surface, &MirSurface::raiseRequested, this, [this, surface](){ this->raise(surface); });

Ditto

review: Needs Information
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

In DecoratedWindow.qml:

// FIXME: priv.animationDuration reaches out of context... neads cleanup before landing
Behavior on opacity { UbuntuNumberAnimation { duration: priv.animationDuration } }

$ make tryDecoratedWindow
$ file:///home/ltinkl/bzr/unity8/unified-stages/qml/Stage/DecoratedWindow.qml:149: ReferenceError: priv is not defined

review: Needs Fixing
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

In the same test (pressing match/animateToShellOrientation buttons)

file:///home/ltinkl/bzr/unity8/unified-stages/tests/qmltests/Stage/tst_DecoratedWindow.qml:141: TypeError: Property 'matchShellOrientation' of object DecoratedWindow_QMLTYPE_62(0x41c7c20) is not a function

file:///home/ltinkl/bzr/unity8/unified-stages/tests/qmltests/Stage/tst_DecoratedWindow.qml:145: TypeError: Property 'animateToShellOrientation' of object DecoratedWindow_QMLTYPE_62(0x41c7c20) is not a function

review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

That's a common situation on the phone and currently it doesn't look good:
https://youtu.be/-WFEf6VEvUw

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2580
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2243/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2954
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1629
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1629
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1629
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2982
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2840/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2840
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2840/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2243/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2582
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2246/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2957
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1630
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1630/console
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1630
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2985
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2843/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2843
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2843/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2246/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Resize got worse. Specially how the surface bleeds beyond window boundaries when enlarging it (2:33).

https://youtu.be/XXa_umGuv44

Resize after unified-stages start at 1:25

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2582
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2249/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2960
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1631
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1631
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1631
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2988
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2847/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2847
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2847/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2249/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Resize got worse. Specially how the surface bleeds beyond window boundaries
> when enlarging it (2:33).
>
> https://youtu.be/XXa_umGuv44
>
> Resize after unified-stages start at 1:25

fixed. good catch, it was a stupid little mistake in wiring up things after refactoring

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2583
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2252/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/2964/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2992
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2850/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2850/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2850/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2850/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2850/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2850
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2850/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2252/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2586
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2254/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2967
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1634/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1634/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1634/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2995
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2853/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2853
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2853/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2254/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Slowly push against right edge a bit then slowly move back.
It moves onto spread view smoothly but changes back abruptly and staggers in some intermediate state in-between. Same happens when you click on a window on the spread.

https://youtu.be/KqLELfZ9zyo

If it can't animate from spread state back to normal state, it should at least do a proper immediate transition without staggering in this intermediate state for a moment.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Bunch of debug leftovers in Stage.qml:

"""
onTriggered: {print("tigggggered"); priv.minimizeAllWindows()}
"""

"""
print("have delegate", appDelegate.appId)
"""

"""
print("minimizing it", appDelegate.appId)
"""

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Bunch of debug leftovers in Stage.qml:
>
> """
> onTriggered: {print("tigggggered"); priv.minimizeAllWindows()}
> """
>
> """
> print("have delegate", appDelegate.appId)
> """
>
> """
> print("minimizing it", appDelegate.appId)
> """

fixed

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> That's a common situation on the phone and currently it doesn't look good:
> https://youtu.be/-WFEf6VEvUw

OK. I have improved this according to design's guidance. We're not 100% happy with it yet, but at least it doesn't look broken any more.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Slowly push against right edge a bit then slowly move back.
> It moves onto spread view smoothly but changes back abruptly and staggers in
> some intermediate state in-between. Same happens when you click on a window on
> the spread.
>
> https://youtu.be/KqLELfZ9zyo
>
> If it can't animate from spread state back to normal state, it should at least
> do a proper immediate transition without staggering in this intermediate state
> for a moment.

fixed...

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Okay... I think I fixed all of the comments here, except the difference between trunk and this branch in regard to the orientation of the apps *in* the spread. That, however, is really what design wants and we are aware that there's room for improvement on how it looks/behaves and we will iterate on things. I'd prefer to keep logic around the not implemented rotation related functions for now, and then drop them when we reached the final conclusion on the spread & rotation with design.

So, unless you guys find some serious bugs, or something in the code that really needs fixing/cleaning up, I would vote for bringing this branch to an end now to unblock people working on top of this and iterate afterwards.

Daniel, Lukas, wdyt?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> So, unless you guys find some serious bugs, [...] I would vote for bringing this branch to an
> end now [...] and iterate afterwards.
>
> Daniel, Lukas, wdyt?

Ok.

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2590
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2261/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2982
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1645
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1645
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1645
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3010
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2868/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2868
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2868/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2261/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2593
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2264/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2985
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1648
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1648
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1648
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3013
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2871/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2871
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2871/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2264/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

This test is still failing, even locally, needs fixing:

FAIL! : qmltestrunner::PhoneStage::test_enterSpread(>breakPoint (trigger)) property focusedApplicationId
   Actual (): facebook-webapp
   Expected ():
   Loc: [/home/ltinkl/bzr/unity8/unified-stages/tests/qmltests/Stage/tst_PhoneStage.qml(229)]

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

On 28.09.2016 21:31, Lukáš Tinkl wrote:
> Review: Needs Fixing
>
> This test is still failing, even locally, needs fixing:
>
> FAIL! : qmltestrunner::PhoneStage::test_enterSpread(>breakPoint (trigger)) property focusedApplicationId
> Actual (): facebook-webapp
> Expected ():
> Loc: [/home/ltinkl/bzr/unity8/unified-stages/tests/qmltests/Stage/tst_PhoneStage.qml(229)]
>
>

Fixed

Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Waiting for CI for the top approval, but this should be good enough now. Thanks!

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2594
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2280/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3001
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1661
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1661
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1661
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3029
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2886/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2886
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2886/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2280/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Found a small issue while testing this in the silo:

In desktop mode, newly launched apps are correctly focused but never raised (brought to the top), regardless of whether started from launcher, dash or indicators

review: Needs Fixing
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2595
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2303/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3036
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1685
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1685
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1685
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3064
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2921/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2921
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2921/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2303/rebuild

review: Needs Fixing (continuous-integration)
lp:~mzanetti/unity8/unified-stages updated
2596. By Michael Zanetti

revert the change that broke the camera app

2597. By Michael Zanetti

fix focusing in windowed mode

2598. By Michael Zanetti

hide close button when the tile is displaced

2599. By Michael Zanetti

merge trunk

2600. By Michael Zanetti

revert changes in changelog

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2596
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2317/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3055
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1702
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1702
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1702
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3083
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2941/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2941
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2941/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2317/rebuild

review: Needs Fixing (continuous-integration)
lp:~mzanetti/unity8/unified-stages updated
2601. By Michael Zanetti

fix ghost rect on corner maximize

2602. By Michael Zanetti

fix OSK rect not always going away when it should

2603. By Michael Zanetti

fix test flakiness

2604. By Michael Zanetti

fix spread close input area

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2016-10-04 15:02:29 +0000
+++ debian/changelog 2016-10-05 14:03:04 +0000
@@ -7,7 +7,7 @@
77
8 -- Michael Terry <mterry@ubuntu.com> Mon, 03 Oct 2016 10:43:25 -04008 -- Michael Terry <mterry@ubuntu.com> Mon, 03 Oct 2016 10:43:25 -0400
99
10unity8 (8.14+16.10.20160922-0ubuntu1) yakkety; urgency=medium10unity8 (8.14+16.10.20160914-0ubuntu1) yakkety; urgency=medium
1111
12 [ Albert Astals Cid ]12 [ Albert Astals Cid ]
13 * LVWPH: update clipItem height when list height changes (LP:13 * LVWPH: update clipItem height when list height changes (LP:
@@ -55,12 +55,14 @@
55 the greeter.55 the greeter.
5656
57 [ Lukáš Tinkl ]57 [ Lukáš Tinkl ]
58 * Implement edge maximizing (aka window snapping) (LP: #1602628)
59 * On the PC platform (as opposed to running on $devices), use the58 * On the PC platform (as opposed to running on $devices), use the
60 "mute" action instead of silent mode59 "mute" action instead of silent mode
61 * Respect Fitt's law wrt the window control buttons in panel (LP:60 * Respect Fitt's law wrt the window control buttons in panel (LP:
62 #1611959)61 #1611959)
63 * Fix 2 failing color-related tests62 * Fix 2 failing color-related tests
63 * Implement edge maximizing (aka window snapping) (LP: #1602628,
64 #1611859)
65 * Implement moving windows by Alt + left mouse button
6466
65 [ Marco Trevisan (Treviño) ]67 [ Marco Trevisan (Treviño) ]
66 * Indicators, mocks: add fake indicators menuitem to populate mocks68 * Indicators, mocks: add fake indicators menuitem to populate mocks
@@ -82,7 +84,7 @@
82 * Update look of infographic a bit84 * Update look of infographic a bit
83 * Make infographic bubbles white even on the default wallpaper.85 * Make infographic bubbles white even on the default wallpaper.
8486
85 -- Michał Sawicz <michal.sawicz@canonical.com> Thu, 22 Sep 2016 07:46:57 +000087 -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 14 Sep 2016 00:46:45 +0000
8688
87unity8 (8.14+16.10.20160831.3-0ubuntu1) yakkety; urgency=medium89unity8 (8.14+16.10.20160831.3-0ubuntu1) yakkety; urgency=medium
8890
8991
=== modified file 'debian/unity8.install'
--- debian/unity8.install 2016-06-20 22:42:46 +0000
+++ debian/unity8.install 2016-10-05 14:03:04 +0000
@@ -16,7 +16,7 @@
16usr/share/unity8/OrientedShell.qml16usr/share/unity8/OrientedShell.qml
17usr/share/unity8/DisabledScreenNotice.qml17usr/share/unity8/DisabledScreenNotice.qml
18usr/share/unity8/Shell.qml18usr/share/unity8/Shell.qml
19usr/share/unity8/Stages19usr/share/unity8/Stage
20usr/share/unity8/Tutorial20usr/share/unity8/Tutorial
21usr/share/unity8/Wizard21usr/share/unity8/Wizard
22usr/share/url-dispatcher/urls/unity8-dash.url-dispatcher22usr/share/url-dispatcher/urls/unity8-dash.url-dispatcher
2323
=== modified file 'plugins/Ubuntu/Gestures/TouchGate.cpp'
--- plugins/Ubuntu/Gestures/TouchGate.cpp 2016-07-13 07:29:00 +0000
+++ plugins/Ubuntu/Gestures/TouchGate.cpp 2016-10-05 14:03:04 +0000
@@ -61,7 +61,10 @@
61 const QTouchEvent::TouchPoint &touchPoint = touchPoints[i];61 const QTouchEvent::TouchPoint &touchPoint = touchPoints[i];
6262
63 if (touchPoint.state() == Qt::TouchPointPressed) {63 if (touchPoint.state() == Qt::TouchPointPressed) {
64 Q_ASSERT(!m_touchInfoMap.contains(touchPoint.id()));64// FIXME: This assert triggers frequently in make trySomething. We have verified
65// that it's a bug in the mouse to touch conversion of the test environment
66// and not in the actual product. Still, it probably should be cleaned up eventually.
67// Q_ASSERT(!m_touchInfoMap.contains(touchPoint.id()));
65 m_touchInfoMap[touchPoint.id()].ownership = OwnershipRequested;68 m_touchInfoMap[touchPoint.id()].ownership = OwnershipRequested;
66 m_touchInfoMap[touchPoint.id()].ended = false;69 m_touchInfoMap[touchPoint.id()].ended = false;
67 TouchRegistry::instance()->requestTouchOwnership(touchPoint.id(), this);70 TouchRegistry::instance()->requestTouchOwnership(touchPoint.id(), this);
6871
=== modified file 'plugins/WindowManager/TopLevelSurfaceList.cpp'
--- plugins/WindowManager/TopLevelSurfaceList.cpp 2016-04-04 13:43:41 +0000
+++ plugins/WindowManager/TopLevelSurfaceList.cpp 2016-10-05 14:03:04 +0000
@@ -133,11 +133,6 @@
133133
134void TopLevelSurfaceList::connectSurface(MirSurfaceInterface *surface)134void TopLevelSurfaceList::connectSurface(MirSurfaceInterface *surface)
135{135{
136 connect(surface, &MirSurfaceInterface::focusedChanged, this, [this, surface](bool focused){
137 if (focused) {
138 this->raise(surface);
139 }
140 });
141 connect(surface, &MirSurfaceInterface::liveChanged, this, [this, surface](bool live){136 connect(surface, &MirSurfaceInterface::liveChanged, this, [this, surface](bool live){
142 if (!live) {137 if (!live) {
143 onSurfaceDied(surface);138 onSurfaceDied(surface);
144139
=== modified file 'qml/CMakeLists.txt'
--- qml/CMakeLists.txt 2015-03-06 04:44:11 +0000
+++ qml/CMakeLists.txt 2016-10-05 14:03:04 +0000
@@ -12,7 +12,7 @@
12 Launcher12 Launcher
13 Notifications13 Notifications
14 Panel14 Panel
15 Stages15 Stage
16 Rotation16 Rotation
17 Tutorial17 Tutorial
18 Wizard18 Wizard
1919
=== modified file 'qml/Components/EdgeBarrier.qml'
--- qml/Components/EdgeBarrier.qml 2016-02-15 16:43:56 +0000
+++ qml/Components/EdgeBarrier.qml 2016-10-05 14:03:04 +0000
@@ -29,6 +29,8 @@
29 // Supported values are: Qt.LeftEdge, Qt.RightEdge29 // Supported values are: Qt.LeftEdge, Qt.RightEdge
30 property int edge: Qt.LeftEdge30 property int edge: Qt.LeftEdge
3131
32 readonly property alias progress: controller.progress
33
32 property Item target: parent34 property Item target: parent
33 function push(amount) { controller.push(amount); }35 function push(amount) { controller.push(amount); }
34 signal passed()36 signal passed()
3537
=== modified file 'qml/Components/FloatingFlickable.qml'
--- qml/Components/FloatingFlickable.qml 2016-08-08 10:41:38 +0000
+++ qml/Components/FloatingFlickable.qml 2016-10-05 14:03:04 +0000
@@ -35,6 +35,9 @@
35 property alias contentX: flickable.contentX35 property alias contentX: flickable.contentX
36 property alias contentY: flickable.contentY36 property alias contentY: flickable.contentY
37 property alias direction: swipeArea.direction37 property alias direction: swipeArea.direction
38 property alias leftMargin: flickable.leftMargin
39 property alias rightMargin: flickable.rightMargin
40 property alias dragging: flickable.dragging
3841
39 MouseEventGenerator {42 MouseEventGenerator {
40 id: mouseEventGenerator43 id: mouseEventGenerator
4144
=== modified file 'qml/Greeter/LoginAreaContainer.qml'
--- qml/Greeter/LoginAreaContainer.qml 2016-06-14 17:34:35 +0000
+++ qml/Greeter/LoginAreaContainer.qml 2016-10-05 14:03:04 +0000
@@ -26,7 +26,7 @@
26 rightMargin: -units.gu(1.5)26 rightMargin: -units.gu(1.5)
27 bottomMargin: -units.gu(1.5)27 bottomMargin: -units.gu(1.5)
28 }28 }
29 source: "../Stages/graphics/dropshadow2gu.sci"29 source: "../graphics/dropshadow2gu.sci"
30 opacity: 0.3530 opacity: 0.35
31 }31 }
3232
3333
=== modified file 'qml/Notifications/Notification.qml'
--- qml/Notifications/Notification.qml 2016-08-19 13:27:05 +0000
+++ qml/Notifications/Notification.qml 2016-10-05 14:03:04 +0000
@@ -143,7 +143,7 @@
143 fill: contents143 fill: contents
144 margins: shapedBack.visible ? -units.gu(1) : -units.gu(1.5)144 margins: shapedBack.visible ? -units.gu(1) : -units.gu(1.5)
145 }145 }
146 source: "../Stages/graphics/dropshadow2gu.sci"146 source: "../graphics/dropshadow2gu.sci"
147 opacity: notification.opacity * 0.5147 opacity: notification.opacity * 0.5
148 enabled: !fullscreen148 enabled: !fullscreen
149 }149 }
150150
=== modified file 'qml/Rotation/RotationStates.qml'
--- qml/Rotation/RotationStates.qml 2016-04-29 12:52:53 +0000
+++ qml/Rotation/RotationStates.qml 2016-10-05 14:03:04 +0000
@@ -121,12 +121,6 @@
121 }121 }
122 }122 }
123123
124 property var shellBeingResized: Binding {
125 target: root.shell
126 property: "beingResized"
127 value: d.transitioning
128 }
129
130 readonly property int fullAnimation: 0124 readonly property int fullAnimation: 0
131 readonly property int indicatorsBarAnimation: 1125 readonly property int indicatorsBarAnimation: 1
132 readonly property int noAnimation: 2126 readonly property int noAnimation: 2
133127
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2016-09-22 07:42:01 +0000
+++ qml/Shell.qml 2016-10-05 14:03:04 +0000
@@ -35,7 +35,7 @@
35import "Panel"35import "Panel"
36import "Components"36import "Components"
37import "Notifications"37import "Notifications"
38import "Stages"38import "Stage"
39import "Tutorial"39import "Tutorial"
40import "Wizard"40import "Wizard"
41import Unity.Notifications 1.0 as NotificationBackend41import Unity.Notifications 1.0 as NotificationBackend
@@ -58,24 +58,22 @@
58 property real nativeWidth58 property real nativeWidth
59 property real nativeHeight59 property real nativeHeight
60 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress60 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress
61 property bool beingResized
62 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"61 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"
63 property string mode: "full-greeter"62 property string mode: "full-greeter"
64 property alias oskEnabled: inputMethod.enabled63 property alias oskEnabled: inputMethod.enabled
65 function updateFocusedAppOrientation() {64 function updateFocusedAppOrientation() {
66 applicationsDisplayLoader.item.updateFocusedAppOrientation();65 stage.updateFocusedAppOrientation();
67 }66 }
68 function updateFocusedAppOrientationAnimated() {67 function updateFocusedAppOrientationAnimated() {
69 applicationsDisplayLoader.item.updateFocusedAppOrientationAnimated();68 stage.updateFocusedAppOrientationAnimated();
70 }69 }
71 property bool hasMouse: false70 property bool hasMouse: false
7271
73 // to be read from outside72 // to be read from outside
74 readonly property int mainAppWindowOrientationAngle:73 readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
75 applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainAppWindowOrientationAngle : 0
7674
77 readonly property bool orientationChangesEnabled: panel.indicators.fullyClosed75 readonly property bool orientationChangesEnabled: panel.indicators.fullyClosed
78 && (applicationsDisplayLoader.item && applicationsDisplayLoader.item.orientationChangesEnabled)76 && stage.orientationChangesEnabled
79 && (!greeter || !greeter.animating)77 && (!greeter || !greeter.animating)
8078
81 readonly property bool showingGreeter: greeter && greeter.shown79 readonly property bool showingGreeter: greeter && greeter.shown
@@ -89,19 +87,13 @@
89 return Qt.PrimaryOrientation;87 return Qt.PrimaryOrientation;
90 } else if (showingGreeter || notifications.topmostIsFullscreen) {88 } else if (showingGreeter || notifications.topmostIsFullscreen) {
91 return Qt.PrimaryOrientation;89 return Qt.PrimaryOrientation;
92 } else if (applicationsDisplayLoader.item) {
93 return shell.orientations.map(applicationsDisplayLoader.item.supportedOrientations);
94 } else {90 } else {
95 // we just don't care91 return shell.orientations.map(stage.supportedOrientations);
96 return Qt.PortraitOrientation
97 | Qt.LandscapeOrientation
98 | Qt.InvertedPortraitOrientation
99 | Qt.InvertedLandscapeOrientation;
100 }92 }
101 }93 }
10294
103 readonly property var mainApp:95 readonly property var mainApp: stage.mainApp
104 applicationsDisplayLoader.item ? applicationsDisplayLoader.item.mainApp : null96
105 onMainAppChanged: {97 onMainAppChanged: {
106 if (mainApp) {98 if (mainApp) {
107 _onMainAppChanged(mainApp.appId);99 _onMainAppChanged(mainApp.appId);
@@ -278,154 +270,50 @@
278 applicationsModel: ApplicationManager270 applicationsModel: ApplicationManager
279 }271 }
280272
281 Loader {273 Stage {
282 id: applicationsDisplayLoader274 id: stage
283 objectName: "applicationsDisplayLoader"275 objectName: "stage"
284 anchors.fill: parent276 anchors.fill: parent
285277 focus: true
286 // When we have a locked app, we only want to show that one app.278
287 // FIXME: do this in a less traumatic way. We currently only allow279 dragAreaWidth: shell.edgeSize
288 // locked apps in phone mode (see FIXME in Lockscreen component in280 background: wallpaperResolver.background
289 // this same file). When that changes, we need to do something281 leftEdgeDragProgress: !greeter || greeter.locked || !tutorial.launcherLongSwipeEnabled ? 0 :
290 // nicer here. But this code is currently just to prevent a282 Math.max(0, (launcher.dragDistance * (stage.width - launcher.panelWidth) / stage.width) - launcher.panelWidth)
291 // theoretical attack where user enters lockedApp mode, then makes283
292 // the screen larger (maybe connects to monitor) and tries to enter284 applicationManager: ApplicationManager
293 // tablet mode.285 topLevelSurfaceList: topLevelSurfaceList
286 inputMethodRect: inputMethod.visibleRect
294287
295 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp288 property string usageScenario: shell.usageScenario === "phone" || greeter.hasLockedApp
296 ? "phone"289 ? "phone"
297 : shell.usageScenario290 : shell.usageScenario
298 readonly property string qmlComponent: {291
299 if (applicationsDisplayLoader.usageScenario === "phone") {292 mode: usageScenario == "phone" ? "staged"
300 return "Stages/PhoneStage.qml";293 : usageScenario == "tablet" ? "stagedWithSideStage"
301 } else if (applicationsDisplayLoader.usageScenario === "tablet") {294 : "windowed"
302 return "Stages/TabletStage.qml";295
303 } else {296 shellOrientation: shell.orientation
304 return "Stages/DesktopStage.qml";297 shellOrientationAngle: shell.orientationAngle
305 }298 orientations: shell.orientations
306 }299 nativeWidth: shell.nativeWidth
307 // TODO: Ensure the current stage is destroyed before the new one gets loaded.300 nativeHeight: shell.nativeHeight
308 // Currently the new one will get loaded while the old is still hanging301
309 // around for a bit, which might lead to conflicts where both stages302 interactive: (!greeter || !greeter.shown)
310 // change the model simultaneously.
311 onQmlComponentChanged: {
312 if (item) item.stageAboutToBeUnloaded();
313 source = qmlComponent;
314 }
315
316 property bool interactive: (!greeter || !greeter.shown)
317 && panel.indicators.fullyClosed303 && panel.indicators.fullyClosed
318 && launcher.progress == 0304 && launcher.progress == 0
319 && !notifications.useModal305 && !notifications.useModal
320306
321 onInteractiveChanged: { if (interactive) { focus = true; } }307 onInteractiveChanged: { if (interactive) { focus = true; } }
322308
323 Binding {309 leftMargin: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
324 target: applicationsDisplayLoader.item310 suspended: greeter.shown
325 property: "focus"311 keepDashRunning: launcher.shown || launcher.dashSwipe
326 value: true312 altTabPressed: physicalKeysMapper.altTabPressed
327 }313 oskEnabled: shell.oskEnabled
328 Binding {314
329 target: applicationsDisplayLoader.item315 // TODO: This is not implemented yet in the new stage...
330 property: "objectName"316 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
331 value: "stage"
332 }
333 Binding {
334 target: applicationsDisplayLoader.item
335 property: "dragAreaWidth"
336 value: shell.edgeSize
337 }
338 Binding {
339 target: applicationsDisplayLoader.item
340 property: "maximizedAppTopMargin"
341 // Not just using panel.panelHeight as that changes depending on the focused app.
342 value: panel.indicators.minimizedPanelHeight
343 }
344 Binding {
345 target: applicationsDisplayLoader.item
346 property: "interactive"
347 value: applicationsDisplayLoader.interactive
348 }
349 Binding {
350 target: applicationsDisplayLoader.item
351 property: "spreadEnabled"
352 value: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
353 }
354 Binding {
355 target: applicationsDisplayLoader.item
356 property: "inverseProgress"
357 value: !greeter || greeter.locked || !tutorial.launcherLongSwipeEnabled ? 0 : launcher.progress
358 }
359 Binding {
360 target: applicationsDisplayLoader.item
361 property: "shellOrientationAngle"
362 value: shell.orientationAngle
363 }
364 Binding {
365 target: applicationsDisplayLoader.item
366 property: "shellOrientation"
367 value: shell.orientation
368 }
369 Binding {
370 target: applicationsDisplayLoader.item
371 property: "orientations"
372 value: shell.orientations
373 }
374 Binding {
375 target: applicationsDisplayLoader.item
376 property: "background"
377 value: wallpaperResolver.cachedBackground
378 }
379 Binding {
380 target: applicationsDisplayLoader.item
381 property: "nativeWidth"
382 value: shell.nativeWidth
383 }
384 Binding {
385 target: applicationsDisplayLoader.item
386 property: "nativeHeight"
387 value: shell.nativeHeight
388 }
389 Binding {
390 target: applicationsDisplayLoader.item
391 property: "beingResized"
392 value: shell.beingResized
393 }
394 Binding {
395 target: applicationsDisplayLoader.item
396 property: "keepDashRunning"
397 value: launcher.shown || launcher.dashSwipe
398 }
399 Binding {
400 target: applicationsDisplayLoader.item
401 property: "suspended"
402 value: greeter.shown
403 }
404 Binding {
405 target: applicationsDisplayLoader.item
406 property: "altTabPressed"
407 value: physicalKeysMapper.altTabPressed
408 }
409 Binding {
410 target: applicationsDisplayLoader.item
411 property: "leftMargin"
412 value: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
413 }
414 Binding {
415 target: applicationsDisplayLoader.item
416 property: "applicationManager"
417 value: ApplicationManager
418 }
419 Binding {
420 target: applicationsDisplayLoader.item
421 property: "topLevelSurfaceList"
422 value: topLevelSurfaceList
423 }
424 Binding {
425 target: applicationsDisplayLoader.item
426 property: "oskEnabled"
427 value: shell.oskEnabled
428 }
429 }317 }
430 }318 }
431319
@@ -442,6 +330,7 @@
442330
443 Loader {331 Loader {
444 id: greeterLoader332 id: greeterLoader
333 objectName: "greeterLoader"
445 anchors.fill: parent334 anchors.fill: parent
446 anchors.topMargin: panel.panelHeight335 anchors.topMargin: panel.panelHeight
447 sourceComponent: shell.mode != "shell" ? integratedGreeter :336 sourceComponent: shell.mode != "shell" ? integratedGreeter :
@@ -650,7 +539,7 @@
650 }539 }
651 onFocusChanged: {540 onFocusChanged: {
652 if (!focus) {541 if (!focus) {
653 applicationsDisplayLoader.focus = true;542 stage.focus = true;
654 }543 }
655 }544 }
656545
@@ -706,12 +595,12 @@
706 delayed: dialogs.hasActiveDialog || notifications.hasNotification ||595 delayed: dialogs.hasActiveDialog || notifications.hasNotification ||
707 inputMethod.visible ||596 inputMethod.visible ||
708 (launcher.shown && !launcher.lockedVisible) ||597 (launcher.shown && !launcher.lockedVisible) ||
709 panel.indicators.shown || stage.dragProgress > 0598 panel.indicators.shown || stage.rightEdgeDragProgress > 0
710 usageScenario: shell.usageScenario599 usageScenario: shell.usageScenario
711 lastInputTimestamp: inputFilter.lastInputTimestamp600 lastInputTimestamp: inputFilter.lastInputTimestamp
712 launcher: launcher601 launcher: launcher
713 panel: panel602 panel: panel
714 stage: applicationsDisplayLoader.item603 stage: stage
715 }604 }
716605
717 Wizard {606 Wizard {
@@ -802,7 +691,7 @@
802 z: dialogs.z + 10691 z: dialogs.z + 10
803 GlobalShortcut { shortcut: Qt.Key_Print; onTriggered: itemGrabber.capture(shell) }692 GlobalShortcut { shortcut: Qt.Key_Print; onTriggered: itemGrabber.capture(shell) }
804 Connections {693 Connections {
805 target: applicationsDisplayLoader.item694 target: stage
806 ignoreUnknownSignals: true695 ignoreUnknownSignals: true
807 onItemSnapshotRequested: itemGrabber.capture(item)696 onItemSnapshotRequested: itemGrabber.capture(item)
808 }697 }
@@ -814,7 +703,7 @@
814 z: itemGrabber.z + 1703 z: itemGrabber.z + 1
815 topBoundaryOffset: panel.panelHeight704 topBoundaryOffset: panel.panelHeight
816705
817 confiningItem: applicationsDisplayLoader.item ? applicationsDisplayLoader.item.itemConfiningMouseCursor : null706 confiningItem: stage.itemConfiningMouseCursor
818707
819 property bool mouseNeverMoved: true708 property bool mouseNeverMoved: true
820 Binding {709 Binding {
@@ -828,10 +717,9 @@
828717
829 height: units.gu(3)718 height: units.gu(3)
830719
831 readonly property var previewRectangle: applicationsDisplayLoader.item && applicationsDisplayLoader.item.previewRectangle &&720 readonly property var previewRectangle: stage.previewRectangle.target &&
832 applicationsDisplayLoader.item.previewRectangle.target &&721 stage.previewRectangle.target.dragging ?
833 applicationsDisplayLoader.item.previewRectangle.target.dragging ?722 stage.previewRectangle : null
834 applicationsDisplayLoader.item.previewRectangle : null
835723
836 onPushedLeftBoundary: {724 onPushedLeftBoundary: {
837 if (buttons === Qt.NoButton) {725 if (buttons === Qt.NoButton) {
@@ -842,9 +730,8 @@
842 }730 }
843731
844 onPushedRightBoundary: {732 onPushedRightBoundary: {
845 if (buttons === Qt.NoButton && applicationsDisplayLoader.item733 if (buttons === Qt.NoButton) {
846 && applicationsDisplayLoader.item.pushRightEdge) {734 stage.pushRightEdge(amount);
847 applicationsDisplayLoader.item.pushRightEdge(amount);
848 } else if (buttons === Qt.LeftButton && previewRectangle && previewRectangle.target.canBeMaximizedLeftRight) {735 } else if (buttons === Qt.LeftButton && previewRectangle && previewRectangle.target.canBeMaximizedLeftRight) {
849 previewRectangle.maximizeRight(amount);736 previewRectangle.maximizeRight(amount);
850 }737 }
851738
=== renamed directory 'qml/Stages' => 'qml/Stage'
=== modified file 'qml/Stage/ApplicationWindow.qml'
--- qml/Stages/ApplicationWindow.qml 2016-08-08 11:18:19 +0000
+++ qml/Stage/ApplicationWindow.qml 2016-10-05 14:03:04 +0000
@@ -20,8 +20,8 @@
2020
21FocusScope {21FocusScope {
22 id: root22 id: root
23 implicitWidth: surfaceContainer.implicitWidth23 implicitWidth: requestedWidth
24 implicitHeight: surfaceContainer.implicitHeight24 implicitHeight: requestedHeight
2525
26 // to be read from outside26 // to be read from outside
27 property alias interactive: surfaceContainer.interactive27 property alias interactive: surfaceContainer.interactive
@@ -29,22 +29,10 @@
29 readonly property string title: surface && surface.name !== "" ? surface.name : d.name29 readonly property string title: surface && surface.name !== "" ? surface.name : d.name
30 readonly property QtObject focusedSurface: d.focusedSurface.surface30 readonly property QtObject focusedSurface: d.focusedSurface.surface
3131
32 // overridable from outside
33 property bool fullscreen: {
34 if (surface) {
35 return surface.state === Mir.FullscreenState;
36 } else if (application) {
37 return application.fullscreen;
38 } else {
39 return false;
40 }
41 }
42
43 // to be set from outside32 // to be set from outside
44 property QtObject surface33 property QtObject surface
45 property QtObject application34 property QtObject application
46 property int surfaceOrientationAngle35 property int surfaceOrientationAngle
47 property alias resizeSurface: surfaceContainer.resizeSurface
48 property int requestedWidth: -136 property int requestedWidth: -1
49 property int requestedHeight: -137 property int requestedHeight: -1
50 property real splashRotation: 038 property real splashRotation: 0
@@ -156,6 +144,9 @@
156 id: screenshotImage144 id: screenshotImage
157 objectName: "screenshotImage"145 objectName: "screenshotImage"
158 anchors.fill: parent146 anchors.fill: parent
147 fillMode: Image.PreserveAspectCrop
148 horizontalAlignment: Image.AlignLeft
149 verticalAlignment: Image.AlignTop
159 antialiasing: !root.interactive150 antialiasing: !root.interactive
160 z: 1151 z: 1
161152
@@ -197,6 +188,7 @@
197188
198 SurfaceContainer {189 SurfaceContainer {
199 id: surfaceContainer190 id: surfaceContainer
191 anchors.fill: parent
200 z: splashLoader.z + 1192 z: splashLoader.z + 1
201 requestedWidth: root.requestedWidth193 requestedWidth: root.requestedWidth
202 requestedHeight: root.requestedHeight194 requestedHeight: root.requestedHeight
@@ -220,6 +212,8 @@
220 surface: model.surface212 surface: model.surface
221 width: root.width213 width: root.width
222 height: root.height214 height: root.height
215 requestedWidth: root.requestedWidth
216 requestedHeight: root.requestedHeight
223 isPromptSurface: true217 isPromptSurface: true
224 z: surfaceContainer.z + (promptSurfacesRepeater.count - index)218 z: surfaceContainer.z + (promptSurfacesRepeater.count - index)
225 property int index: model.index219 property int index: model.index
@@ -239,28 +233,6 @@
239 property Item first: null233 property Item first: null
240 }234 }
241235
242 // SurfaceContainer size drives ApplicationWindow size
243 Binding {
244 target: root; property: "width"
245 value: stateGroup.state === "surface" ? surfaceContainer.width : root.requestedWidth
246 when: root.requestedWidth >= 0
247 }
248 Binding {
249 target: root; property: "height"
250 value: stateGroup.state === "surface" ? surfaceContainer.height : root.requestedHeight
251 when: root.requestedHeight >= 0
252 }
253
254 // ApplicationWindow size drives SurfaceContainer size
255 Binding {
256 target: surfaceContainer; property: "width"; value: root.width
257 when: root.requestedWidth < 0
258 }
259 Binding {
260 target: surfaceContainer; property: "height"; value: root.height
261 when: root.requestedHeight < 0
262 }
263
264 StateGroup {236 StateGroup {
265 id: stateGroup237 id: stateGroup
266 objectName: "applicationWindowStateGroup"238 objectName: "applicationWindowStateGroup"
@@ -287,6 +259,11 @@
287 (d.liveSurface ||259 (d.liveSurface ||
288 (d.applicationState !== ApplicationInfoInterface.Running260 (d.applicationState !== ApplicationInfoInterface.Running
289 && screenshotImage.status !== Image.Ready))261 && screenshotImage.status !== Image.Ready))
262 PropertyChanges {
263 target: root
264 implicitWidth: surfaceContainer.implicitWidth
265 implicitHeight: surfaceContainer.implicitHeight
266 }
290 },267 },
291 State {268 State {
292 name: "screenshot"269 name: "screenshot"
@@ -424,5 +401,4 @@
424 }401 }
425 ]402 ]
426 }403 }
427
428}404}
429405
=== modified file 'qml/Stage/DecoratedWindow.qml'
--- qml/Stages/DecoratedWindow.qml 2016-09-08 14:13:27 +0000
+++ qml/Stage/DecoratedWindow.qml 2016-10-05 14:03:04 +0000
@@ -17,34 +17,46 @@
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Unity.Application 0.119import Unity.Application 0.1
20import "Spread/MathUtils.js" as MathUtils
2021
21FocusScope {22FocusScope {
22 id: root23 id: root
2324
24 width: !counterRotate ? applicationWindow.width : applicationWindow.height25 // The DecoratedWindow takes requestedWidth/requestedHeight and asks its surface to be resized to that
25 height: visibleDecorationHeight + (!counterRotate ? applicationWindow.height : applicationWindow.width)26 // (minus the window decoration size in case hasDecoration and showDecoration are true)
27 // The surface might not be able to resize to the requested values. It will return its actual size
28 // in implicitWidth/implicitHeight.
2629
27 property alias application: applicationWindow.application30 property alias application: applicationWindow.application
28 property alias surface: applicationWindow.surface31 property alias surface: applicationWindow.surface
29 readonly property alias focusedSurface: applicationWindow.focusedSurface32 readonly property alias focusedSurface: applicationWindow.focusedSurface
30 property alias active: decoration.active33 property alias active: decoration.active
31 readonly property alias title: applicationWindow.title34 readonly property alias title: applicationWindow.title
32 property alias fullscreen: applicationWindow.fullscreen
33 property alias maximizeButtonShown: decoration.maximizeButtonShown35 property alias maximizeButtonShown: decoration.maximizeButtonShown
36 property alias interactive: applicationWindow.interactive
37 readonly property alias orientationChangesEnabled: applicationWindow.orientationChangesEnabled
3438
35 readonly property bool decorationShown: !fullscreen39 // Changing this will actually add/remove a decoration, meaning, requestedHeight will take the decoration into account.
36 property bool highlightShown: false40 property bool hasDecoration: true
37 property real shadowOpacity: 141 // This will temporarily show/hide the decoration without actually changing the surface's dimensions
42 property real showDecoration: 1
43 property bool animateDecoration: false
44 property bool showHighlight: false
45 property int highlightSize: units.gu(1)
46 property real shadowOpacity: 0
47 property bool darkening: false
3848
39 property real requestedWidth49 property real requestedWidth
40 property real requestedHeight50 property real requestedHeight
51 property real scaleToPreviewProgress: 0
52 property int scaleToPreviewSize: units.gu(30)
4153
42 property alias surfaceOrientationAngle: applicationWindow.surfaceOrientationAngle54 property alias surfaceOrientationAngle: applicationWindow.surfaceOrientationAngle
43 readonly property real visibleDecorationHeight: root.decorationShown ? decoration.height : 055 readonly property real decorationHeight: Math.min(d.visibleDecorationHeight, d.requestedDecorationHeight)
44 readonly property bool counterRotate: surfaceOrientationAngle != 0 && surfaceOrientationAngle != 18056 readonly property bool counterRotate: surfaceOrientationAngle != 0 && surfaceOrientationAngle != 180
4557
46 readonly property int minimumWidth: !counterRotate ? applicationWindow.minimumWidth : applicationWindow.minimumHeight58 readonly property int minimumWidth: !counterRotate ? applicationWindow.minimumWidth : applicationWindow.minimumHeight
47 readonly property int minimumHeight: visibleDecorationHeight + (!counterRotate ? applicationWindow.minimumHeight : applicationWindow.minimumWidth)59 readonly property int minimumHeight: decorationHeight + (!counterRotate ? applicationWindow.minimumHeight : applicationWindow.minimumWidth)
48 readonly property int maximumWidth: !counterRotate ? applicationWindow.maximumWidth : applicationWindow.maximumHeight60 readonly property int maximumWidth: !counterRotate ? applicationWindow.maximumWidth : applicationWindow.maximumHeight
49 readonly property int maximumHeight: (root.decorationShown && applicationWindow.maximumHeight > 0 ? decoration.height : 0)61 readonly property int maximumHeight: (root.decorationShown && applicationWindow.maximumHeight > 0 ? decoration.height : 0)
50 + (!counterRotate ? applicationWindow.maximumHeight : applicationWindow.maximumWidth)62 + (!counterRotate ? applicationWindow.maximumHeight : applicationWindow.maximumWidth)
@@ -66,40 +78,86 @@
66 signal decorationPressed()78 signal decorationPressed()
67 signal decorationReleased()79 signal decorationReleased()
6880
81 QtObject {
82 id: d
83 property int requestedDecorationHeight: root.hasDecoration ? decoration.height : 0
84 Behavior on requestedDecorationHeight { enabled: root.animateDecoration; UbuntuNumberAnimation { } }
85
86 property int visibleDecorationHeight: root.hasDecoration ? root.showDecoration * decoration.height : 0
87 Behavior on visibleDecorationHeight { enabled: root.animateDecoration; UbuntuNumberAnimation { } }
88 }
89
90 StateGroup {
91 states: [
92 State {
93 name: "normal"; when: root.scaleToPreviewProgress <= 0 && root.application.state === ApplicationInfoInterface.Running
94 PropertyChanges {
95 target: root
96 implicitWidth: counterRotate ? applicationWindow.implicitHeight : applicationWindow.implicitWidth
97 implicitHeight: root.decorationHeight + (counterRotate ? applicationWindow.implicitWidth: applicationWindow.implicitHeight)
98 }
99 },
100 State {
101 name: "normalSuspended"; when: root.scaleToPreviewProgress <= 0 && root.application.state !== ApplicationInfoInterface.Running
102 extend: "normal"
103 PropertyChanges {
104 target: root
105 implicitWidth: counterRotate ? applicationWindow.requestedHeight : applicationWindow.requestedWidth
106 implicitHeight: root.decorationHeight + (counterRotate ? applicationWindow.requestedWidth: applicationWindow.requestedHeight)
107 }
108 },
109 State {
110 name: "preview"; when: root.scaleToPreviewProgress > 0
111 PropertyChanges {
112 target: root
113 implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress)
114 implicitHeight: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, root.scaleToPreviewSize, root.scaleToPreviewProgress)
115 }
116 PropertyChanges {
117 target: applicationWindow;
118 requestedWidth: applicationWindow.oldRequestedWidth
119 requestedHeight: applicationWindow.oldRequestedHeight
120 width: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, applicationWindow.minSize, root.scaleToPreviewProgress)
121 height: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress)
122 itemScale: root.implicitWidth / width
123 }
124 }
125 ]
126 }
127
69 Rectangle {128 Rectangle {
70 id: selectionHighlight129 id: selectionHighlight
130 objectName: "selectionHighlight"
71 anchors.fill: parent131 anchors.fill: parent
72 anchors.margins: -units.gu(1)132 anchors.margins: -root.highlightSize
73 color: "white"133 color: "white"
74 opacity: highlightShown ? 0.15 : 0134 opacity: showHighlight ? 0.55 : 0
75 }135 visible: opacity > 0
76
77 Rectangle {
78 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
79 height: units.dp(2)
80 color: theme.palette.normal.focus
81 visible: highlightShown
82 }136 }
83137
84 BorderImage {138 BorderImage {
139 id: dropShadow
85 anchors {140 anchors {
86 fill: root141 left: parent.left; top: parent.top; right: parent.right
87 margins: active ? -units.gu(2) : -units.gu(1.5)142 margins: active ? -units.gu(2) : -units.gu(1.5)
88 }143 }
89 source: "graphics/dropshadow2gu.sci"144 height: Math.min(applicationWindow.implicitHeight, applicationWindow.height) * applicationWindow.itemScale
90 opacity: root.shadowOpacity * .3145 + root.decorationHeight * Math.min(1, root.showDecoration) + (active ? units.gu(4) : units.gu(3))
91 visible: !fullscreen146 source: "../graphics/dropshadow2gu.sci"
147 opacity: root.shadowOpacity
92 }148 }
93149
94 WindowDecoration {150 WindowDecoration {
95 id: decoration151 id: decoration
96 target: root.parent152 target: root.parent || null
97 objectName: "appWindowDecoration"153 objectName: "appWindowDecoration"
98 anchors { left: parent.left; top: parent.top; right: parent.right }154 anchors { left: parent.left; top: parent.top; right: parent.right }
99 height: units.gu(3)155 height: units.gu(3)
100 width: root.width156 width: root.width
101 title: applicationWindow.title157 title: applicationWindow.title
102 visible: root.decorationShown158 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
159
160 Behavior on opacity { UbuntuNumberAnimation { } }
103161
104 onCloseClicked: root.closeClicked();162 onCloseClicked: root.closeClicked();
105 onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }163 onMaximizeClicked: { root.decorationPressed(); root.maximizeClicked(); }
@@ -126,16 +184,25 @@
126 ApplicationWindow {184 ApplicationWindow {
127 id: applicationWindow185 id: applicationWindow
128 objectName: "appWindow"186 objectName: "appWindow"
187 anchors.left: parent.left
129 anchors.top: parent.top188 anchors.top: parent.top
130 anchors.topMargin: decoration.height189 anchors.topMargin: root.decorationHeight * Math.min(1, root.showDecoration)
131 anchors.left: parent.left190 width: implicitWidth
132 readonly property real requestedHeightMinusDecoration: root.requestedHeight - root.visibleDecorationHeight191 height: implicitHeight
133 requestedHeight: !counterRotate ? requestedHeightMinusDecoration : root.requestedWidth192 requestedHeight: !counterRotate ? root.requestedHeight - d.requestedDecorationHeight : root.requestedWidth
134 requestedWidth: !counterRotate ? root.requestedWidth : requestedHeightMinusDecoration193 requestedWidth: !counterRotate ? root.requestedWidth : root.requestedHeight - d.requestedDecorationHeight
135 interactive: true194 property int oldRequestedWidth: requestedWidth
195 property int oldRequestedHeight: requestedHeight
196 onRequestedWidthChanged: oldRequestedWidth = requestedWidth
197 onRequestedHeightChanged: oldRequestedHeight = requestedHeight
136 focus: true198 focus: true
137199
138 transform: Rotation {200 property real itemScale: 1
201 property real minSize: Math.min(root.scaleToPreviewSize, Math.min(requestedHeight, Math.min(requestedWidth, Math.min(implicitHeight, implicitWidth))))
202
203 transform: [
204 Rotation {
205 id: rotationTransform
139 readonly property int rotationAngle: applicationWindow.application &&206 readonly property int rotationAngle: applicationWindow.application &&
140 applicationWindow.application.rotatesWindowContents207 applicationWindow.application.rotatesWindowContents
141 ? ((360 - applicationWindow.surfaceOrientationAngle) % 360) : 0208 ? ((360 - applicationWindow.surfaceOrientationAngle) % 360) : 0
@@ -152,6 +219,19 @@
152 else return 0;219 else return 0;
153 }220 }
154 angle: rotationAngle221 angle: rotationAngle
155 }222 },
223 Scale {
224 xScale: applicationWindow.itemScale
225 yScale: applicationWindow.itemScale
226 }
227 ]
228
229 }
230
231 Rectangle {
232 anchors.fill: parent
233 color: "black"
234 opacity: root.darkening && !root.showHighlight ? 0.05 : 0
235 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
156 }236 }
157}237}
158238
=== modified file 'qml/Stage/MoveHandler.qml'
--- qml/Stages/MoveHandler.qml 2016-09-08 14:13:27 +0000
+++ qml/Stage/MoveHandler.qml 2016-10-05 14:03:04 +0000
@@ -112,8 +112,8 @@
112 // Use integer coordinate values to ensure that target is left in a pixel-aligned112 // Use integer coordinate values to ensure that target is left in a pixel-aligned
113 // position. Mouse movement could have subpixel precision, yielding a fractional113 // position. Mouse movement could have subpixel precision, yielding a fractional
114 // mouse position.114 // mouse position.
115 target.requestedX = Math.round(pos.x - priv.distanceX);115 target.windowedX = Math.round(pos.x - priv.distanceX);
116 target.requestedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));116 target.windowedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));
117117
118 if (sensingPoints) { // edge/corner detection when dragging via the touch overlay118 if (sensingPoints) { // edge/corner detection when dragging via the touch overlay
119 if (sensingPoints.topLeft.x < priv.triggerArea && sensingPoints.topLeft.y < PanelState.panelHeight + priv.triggerArea119 if (sensingPoints.topLeft.x < priv.triggerArea && sensingPoints.topLeft.y < PanelState.panelHeight + priv.triggerArea
120120
=== modified file 'qml/Stage/PromptSurfaceAnimations.qml'
--- qml/Stages/PromptSurfaceAnimations.qml 2016-04-04 13:38:56 +0000
+++ qml/Stage/PromptSurfaceAnimations.qml 2016-10-05 14:03:04 +0000
@@ -43,7 +43,7 @@
43 SequentialAnimation {43 SequentialAnimation {
44 // clip so we don't go out of parent's bounds during spread44 // clip so we don't go out of parent's bounds during spread
45 PropertyAction { target: root.container.parent; property: "clip"; value: true }45 PropertyAction { target: root.container.parent; property: "clip"; value: true }
46 UbuntuNumberAnimation { target: root.surfaceItem; property: "y"; to: root.container.height46 UbuntuNumberAnimation { target: root.surfaceItem; property: "anchors.topMargin"; to: root.container.height
47 duration: UbuntuAnimation.BriskDuration }47 duration: UbuntuAnimation.BriskDuration }
48 PropertyAction { target: root.surfaceItem; property: "visible"; value: false }48 PropertyAction { target: root.surfaceItem; property: "visible"; value: false }
49 PropertyAction { target: container.parent; property: "clip"; value: false }49 PropertyAction { target: container.parent; property: "clip"; value: false }
@@ -61,11 +61,10 @@
61 // clip so we don't go out of parent's bounds during spread61 // clip so we don't go out of parent's bounds during spread
62 PropertyAction { target: root.container.parent; property: "clip"; value: true }62 PropertyAction { target: root.container.parent; property: "clip"; value: true }
63 ScriptAction { script: {63 ScriptAction { script: {
64 root.surfaceItem.y = root.container.height;
65 root.surfaceItem.visible = true;64 root.surfaceItem.visible = true;
66 } }65 } }
67 UbuntuNumberAnimation {66 UbuntuNumberAnimation {
68 target: root.surfaceItem; property: "y"; to: 067 target: root.surfaceItem; property: "anchors.topMargin"; from: root.container.height; to: 0
69 duration: UbuntuAnimation.BriskDuration68 duration: UbuntuAnimation.BriskDuration
70 }69 }
71 PropertyAction { target: container.parent; property: "clip"; value: false }70 PropertyAction { target: container.parent; property: "clip"; value: false }
7271
=== added directory 'qml/Stage/Spread'
=== added file 'qml/Stage/Spread/BezierCurve.qml'
--- qml/Stage/Spread/BezierCurve.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/BezierCurve.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import QtQuick.Window 2.2
20import 'cubic-bezier.js' as Bezier
21import 'KeySpline.js' as KeySpline
22
23Item {
24 id: root
25
26 property var controlPoint1: {'x':0, 'y':0}
27 property var controlPoint2: {'x':0, 'y':0}
28 property var controlPoint3: {'x':0.58, 'y':1}
29 property var controlPoint4: {'x':1, 'y':1}
30
31 function getValues(t) {
32 if (t<0) t=0
33 else if (t>1)t=1
34
35 return Bezier.getBezier(t, controlPoint1, controlPoint2, controlPoint3, controlPoint4)
36 }
37
38 function getYFromX(x) {
39 var spline = new KeySpline.keySpline(controlPoint2.x, controlPoint2.y, controlPoint3.x, controlPoint3.y)
40 if (x<0) x=0
41 else if (x>1)x=1
42
43 return spline.get(x)
44 }
45}
046
=== added file 'qml/Stage/Spread/KeySpline.js'
--- qml/Stage/Spread/KeySpline.js 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/KeySpline.js 2016-10-05 14:03:04 +0000
@@ -0,0 +1,66 @@
1/** MIT License
2 *
3 * KeySpline - use bezier curve for transition easing function
4 * Copyright (c) 2012 Gaetan Renaudeau <renaudeau.gaetan@gmail.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24/**
25* KeySpline - use bezier curve for transition easing function
26* is inspired from Firefox's nsSMILKeySpline.cpp
27* Usage:
28* var spline = new KeySpline(0.25, 0.1, 0.25, 1.0)
29* spline.get(x) => returns the easing value | x must be in [0, 1] range
30*/
31
32.pragma library
33
34function keySpline (mX1, mY1, mX2, mY2) {
35
36 this.get = function(aX) {
37 if (mX1 == mY1 && mX2 == mY2) return aX; // linear
38 return CalcBezier(GetTForX(aX), mY1, mY2);
39 }
40
41 function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
42 function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
43 function C(aA1) { return 3.0 * aA1; }
44
45 // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
46 function CalcBezier(aT, aA1, aA2) {
47 return ((A(aA1, aA2)*aT + B(aA1, aA2))*aT + C(aA1))*aT;
48 }
49
50 // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
51 function GetSlope(aT, aA1, aA2) {
52 return 3.0 * A(aA1, aA2)*aT*aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
53 }
54
55 function GetTForX(aX) {
56 // Newton raphson iteration
57 var aGuessT = aX;
58 for (var i = 0; i < 4; ++i) {
59 var currentSlope = GetSlope(aGuessT, mX1, mX2);
60 if (currentSlope == 0.0) return aGuessT;
61 var currentX = CalcBezier(aGuessT, mX1, mX2) - aX;
62 aGuessT -= currentX / currentSlope;
63 }
64 return aGuessT;
65 }
66}
067
=== added file 'qml/Stage/Spread/MathUtils.js'
--- qml/Stage/Spread/MathUtils.js 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/MathUtils.js 2016-10-05 14:03:04 +0000
@@ -0,0 +1,95 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17.pragma library
18
19/**
20 * From processing.js: https://raw.githubusercontent.com/processing-js/processing-js/v1.4.8/processing.js
21 *
22 * Re-map a number from one range to another. In the example above, the number
23 * '25' is converted from a value in the range 0..100 into a value that
24 * ranges from the left edge (0) to the right edge (width) of the screen.
25 * Numbers outside the range are not clamped to 0 and 1, because out-of-range
26 * values are often intentional and useful.
27 *
28 * @param {Number} value The incoming value to be converted
29 * @param {Number} istart Lower bound of the value's current range
30 * @param {Number} istop Upper bound of the value's current range
31 * @param {Number} ostart Lower bound of the value's target range
32 * @param {Number} ostop Upper bound of the value's target range
33 *
34 * @returns {Number}
35 */
36function map(value, istart, istop, ostart, ostop) {
37 return ostart + (ostop - ostart) * ((value - istart) / (istop - istart))
38}
39
40/**
41 * Return a value which is always between `min` and `max`
42 *
43 * @param {Number} value The current value
44 * @param {Number} min The minimum value
45 * @param {Number} max The maximum value
46 *
47 * @returns {Number}
48 */
49function clamp(value, min, max) {
50 if (value < min) return min
51 if (value > max) return max
52 return value
53}
54
55// calculates the distance from the middle of one rect to middle of other rect
56function rectDistance(rect1, rect2) {
57 return pointDistance(Qt.point(rect1.x + rect1.width / 2, rect1.y + rect1.height / 2),
58 Qt.point(rect2.x + rect2.width / 2, rect2.y + rect2.height / 2))
59}
60
61// calculates the distance between two points
62function pointDistance(point1, point2) {
63 return Math.sqrt(Math.pow(point1.x - point2.x, 2) +
64 Math.pow(point1.y - point2.y, 2)
65 )
66}
67
68// from http://stackoverflow.com/questions/14616829/java-method-to-find-the-rectangle-that-is-the-intersection-of-two-rectangles-usi
69function intersectionRect(r1, r2) {
70 var xmin = Math.max(r1.x, r2.x);
71 var xmax1 = r1.x + r1.width;
72 var xmax2 = r2.x + r2.width;
73 var xmax = Math.min(xmax1, xmax2);
74 var out = {x:0, y:0, width:0, height:0}
75 if (xmax > xmin) {
76 var ymin = Math.max(r1.y, r2.y);
77 var ymax1 = r1.y + r1.height;
78 var ymax2 = r2.y + r2.height;
79 var ymax = Math.min(ymax1, ymax2);
80 if (ymax > ymin) {
81 out.x = xmin;
82 out.y = ymin;
83 out.width = xmax - xmin;
84 out.height = ymax - ymin;
85 }
86 }
87 return out;
88}
89
90function easeOutCubic(t) { return (--t)*t*t+1 }
91
92function linearAnimation(startProgress, endProgress, startValue, endValue, progress) {
93 // progress : progressDiff = value : valueDiff => value = progress * valueDiff / progressDiff
94 return (progress - startProgress) * (endValue - startValue) / (endProgress - startProgress) + startValue;
95}
096
=== added file 'qml/Stage/Spread/OpacityMask.qml'
--- qml/Stage/Spread/OpacityMask.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/OpacityMask.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,82 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18
19Item {
20 id: root
21 anchors.fill: sourceItem
22 anchors.margins: -units.gu(2)
23 visible: sourceItem !== null
24
25 property var sourceItem: null
26 property int maskX: 0
27 property int maskY: 0
28 property int maskWidth: 0
29 property int maskHeight: 0
30
31 property real opacityValue: 1
32
33 Item {
34 id: opacityMask
35 anchors.fill: parent
36
37 Rectangle {
38 id: clipRect
39 color: "black"
40 x: root.maskX - root.anchors.margins
41 y: root.maskY - root.anchors.margins
42 width: root.maskWidth
43 height: root.maskHeight
44 opacity: 1 - root.opacityValue
45 }
46 }
47
48 ShaderEffect {
49 id: opacityEffect
50 anchors.fill: parent
51
52 property variant source: ShaderEffectSource {
53 id: shaderEffectSource
54 sourceItem: root.sourceItem
55 sourceRect: root.sourceItem ? Qt.rect(sourceItem.x + root.anchors.margins,
56 sourceItem.y + root.anchors.margins,
57 sourceItem.width - root.anchors.margins * 2,
58 sourceItem.height - root.anchors.margins * 2)
59 : Qt.rect(0,0,0,0)
60 hideSource: true
61 }
62
63 property var mask: ShaderEffectSource {
64 sourceItem: opacityMask
65 hideSource: true
66 }
67
68 fragmentShader: "
69 varying highp vec2 qt_TexCoord0;
70 uniform sampler2D source;
71 uniform sampler2D mask;
72 void main(void)
73 {
74 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
75 highp vec4 maskColor = texture2D(mask, qt_TexCoord0);
76
77 sourceColor *= 1.0 - maskColor.a;
78
79 gl_FragColor = sourceColor;
80 }"
81 }
82}
083
=== added file 'qml/Stage/Spread/Spread.qml'
--- qml/Stage/Spread/Spread.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/Spread.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,162 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import "MathUtils.js" as MathUtils
20
21Item {
22 id: root
23
24 // Information about the environment
25 property int highlightedIndex: -1
26 property var model: null
27 property int leftMargin: 0
28 property var spreadFlickable
29
30 // some config options
31 property real contentMargin: 0.16 * root.height
32 property real contentTopMargin: contentMargin
33 property real contentBottomMargin: 0.35 * contentMargin
34 property real windowTitleTopMargin: 3/4 * (contentTopMargin - windowTitle.height)
35 property int stackItemCount: 3
36 property real leftRotationAngle: 22
37 property real rightRotationAngle: 32
38 property real leftStackScale: .82
39 property real rightStackScale: 1
40 property real rightEdgeBreakPoint: Math.min(units.gu(40) / root.width, .35)
41
42 signal leaveSpread()
43
44 // Calculated stuff
45 readonly property int totalItemCount: model.count
46 readonly property real leftStackXPos: 0.03 * root.width + leftMargin
47 readonly property real rightStackXPos: root.width - 1.5 * leftStackXPos + leftMargin
48
49 readonly property real stackHeight: spreadItemHeight - appInfoHeight
50 readonly property real stackWidth: Math.min(leftStackXPos/3, units.gu(1.5))
51
52 readonly property real spreadWidth: rightStackXPos - leftStackXPos
53 readonly property real spreadHeight: root.height
54 readonly property real spreadItemHeight: spreadHeight - contentTopMargin - contentBottomMargin
55 readonly property real spreadItemWidth: stackHeight
56
57 readonly property real dynamicLeftRotationAngle: leftRotationAngle * rotationAngleFactor
58 readonly property real dynamicRightRotationAngle: rightRotationAngle * rotationAngleFactor
59
60 readonly property real appInfoHeight: {
61 var screenHeightReferencePoint = 40 // ref screen height in gu
62 var valueAtReferencePoint = 0.17 // of screen height at the reference point
63 var appInfoHeightValueChange = -0.0014 // units / gu
64 var minAppInfoHeight = 0.08
65 var maxAppInfoHeight = 0.2
66 var screenHeightInGU = root.height / units.gu(1) // screenHeight in gu
67
68 return MathUtils.clamp(valueAtReferencePoint + appInfoHeightValueChange * (screenHeightInGU - screenHeightReferencePoint), minAppInfoHeight, maxAppInfoHeight) * root.height
69 }
70
71 property real rotationAngleFactor: {
72 var spreadHeightReferencePoint = 28 // reference spread height in gu
73 var valueAtReferencePoint = 1.3
74 var rotationAngleValueChange = -0.008 // units / gu
75 var minRotationAngleFactor = 0.6
76 var maxRotationAngleFactor = 1.5
77 var spreadHeightInGU = spreadHeight / units.gu(1)
78
79 return MathUtils.clamp(valueAtReferencePoint + rotationAngleValueChange * (spreadHeightInGU - spreadHeightReferencePoint), minRotationAngleFactor, maxRotationAngleFactor)
80 }
81 readonly property real itemOverlap: {
82 var spreadAspectRatioReferencePoint = 1.0 // ref screen height in gu
83 var valueAtReferencePoint = 0.74 // of screen height at the reference point
84 var itemOverlapValueChange = -0.068
85 var minOverlap = 0.55
86 var maxOverlap = 0.82
87 var spreadAspectRatio = spreadWidth / stackHeight // spread stack aspect ratio (app info not included)
88
89 return MathUtils.clamp(valueAtReferencePoint + itemOverlapValueChange * (spreadAspectRatio - spreadAspectRatioReferencePoint), minOverlap, maxOverlap)
90 }
91
92 readonly property real visibleItemCount: (spreadWidth / spreadItemWidth) / (1 - itemOverlap)
93
94 readonly property real spreadTotalWidth: totalItemCount * spreadWidth / visibleItemCount
95
96 readonly property real centeringOffset: Math.max(spreadWidth - spreadTotalWidth ,0) / (2 * spreadWidth)
97
98
99 readonly property var curve: BezierCurve {
100 controlPoint2: {'x': 0.19, 'y': 0.00}
101 controlPoint3: {'x': 0.91, 'y': 1.00}
102 }
103
104 Label {
105 id: windowTitle
106
107 width: Math.min(implicitWidth, 0.5*root.width)
108 elide: Qt.ElideMiddle
109 anchors.horizontalCenter: parent.horizontalCenter
110 y: windowTitleTopMargin
111 readonly property var highlightedSurface: root.model ? root.model.surfaceAt(root.highlightedIndex) : null
112 readonly property var highlightedApp: root.model ? root.model.applicationAt(root.highlightedIndex) : null
113 text: root.highlightedIndex >= 0 && highlightedSurface && highlightedSurface.name != "" ? highlightedSurface.name :
114 highlightedApp ? highlightedApp.name : ""
115 fontSize: root.height < units.gu(85) ? 'medium' : 'large'
116 color: "white"
117 opacity: root.highlightedIndex >= 0 ? 1 : 0
118 Behavior on opacity { UbuntuNumberAnimation { } }
119 }
120
121 Keys.onPressed: {
122 switch (event.key) {
123 case Qt.Key_Left:
124 case Qt.Key_Backtab:
125 selectPrevious(event.isAutoRepeat)
126 event.accepted = true;
127 break;
128 case Qt.Key_Right:
129 case Qt.Key_Tab:
130 selectNext(event.isAutoRepeat)
131 event.accepted = true;
132 break;
133 case Qt.Key_Escape:
134 highlightedIndex = -1
135 // Falling through intentionally
136 case Qt.Key_Enter:
137 case Qt.Key_Return:
138 case Qt.Key_Space:
139 root.leaveSpread();
140 event.accepted = true;
141 }
142 }
143
144
145 function selectNext(isAutoRepeat) {
146 if (isAutoRepeat && highlightedIndex >= totalItemCount -1) {
147 return; // AutoRepeat is not allowed to wrap around
148 }
149
150 highlightedIndex = (highlightedIndex + 1) % totalItemCount;
151 spreadFlickable.snap(highlightedIndex)
152 }
153
154 function selectPrevious(isAutoRepeat) {
155 if (isAutoRepeat && highlightedIndex == 0) {
156 return; // AutoRepeat is not allowed to wrap around
157 }
158
159 highlightedIndex = highlightedIndex - 1 >= 0 ? highlightedIndex - 1 : totalItemCount - 1;
160 spreadFlickable.snap(highlightedIndex)
161 }
162}
0163
=== added file 'qml/Stage/Spread/SpreadDelegateInputArea.qml'
--- qml/Stage/Spread/SpreadDelegateInputArea.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/SpreadDelegateInputArea.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,183 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Ubuntu.Gestures 0.1
20import "../../Components"
21
22Item {
23 id: root
24
25 property bool closeable: true
26 readonly property real minSpeedToClose: units.gu(40)
27 property bool zeroVelocityCounts: false
28
29 readonly property alias distance: d.distance
30
31 signal clicked()
32 signal close()
33
34 QtObject {
35 id: d
36 property real distance: 0
37 property bool moving: false
38 property var dragEvents: []
39 property real dragVelocity: 0
40 property int threshold: units.gu(2)
41
42 // Can be replaced with a fake implementation during tests
43 // property var __getCurrentTimeMs: function () { return new Date().getTime() }
44 property var __dateTime: new function() {
45 this.getCurrentTimeMs = function() {return new Date().getTime()}
46 }
47
48 function pushDragEvent(event) {
49 var currentTime = __dateTime.getCurrentTimeMs()
50 dragEvents.push([currentTime, event.x, event.y, getEventSpeed(currentTime, event)])
51 cullOldDragEvents(currentTime)
52 updateSpeed()
53 }
54
55 function cullOldDragEvents(currentTime) {
56 // cull events older than 50 ms but always keep the latest 2 events
57 for (var numberOfCulledEvents = 0; numberOfCulledEvents < dragEvents.length-2; numberOfCulledEvents++) {
58 // dragEvents[numberOfCulledEvents][0] is the dragTime
59 if (currentTime - dragEvents[numberOfCulledEvents][0] <= 50) break
60 }
61
62 dragEvents.splice(0, numberOfCulledEvents)
63 }
64
65 function updateSpeed() {
66 var totalSpeed = 0
67 for (var i = 0; i < dragEvents.length; i++) {
68 totalSpeed += dragEvents[i][3]
69 }
70
71 if (zeroVelocityCounts || Math.abs(totalSpeed) > 0.001) {
72 dragVelocity = totalSpeed / dragEvents.length * 1000
73 }
74 }
75
76 function getEventSpeed(currentTime, event) {
77 if (dragEvents.length != 0) {
78 var lastDrag = dragEvents[dragEvents.length-1]
79 var duration = Math.max(1, currentTime - lastDrag[0])
80 return (event.y - lastDrag[2]) / duration
81 } else {
82 return 0
83 }
84 }
85 }
86
87 // Event eater
88 MouseArea {
89 anchors.fill: parent
90 onClicked: root.clicked()
91 onWheel: wheel.accepted = true
92 }
93
94 MultiPointTouchArea {
95 anchors.fill: parent
96 mouseEnabled: false
97 maximumTouchPoints: 1
98 property int offset: 0
99
100 touchPoints: [
101 TouchPoint {
102 id: tp
103 }
104 ]
105
106 onCanceled: {
107 d.moving = false
108 animation.animate("center");
109 }
110
111 onTouchUpdated: {
112 if (!d.moving) {
113 if (Math.abs(tp.startY - tp.y) > d.threshold) {
114 d.moving = true;
115 d.dragEvents = []
116 offset = tp.y - tp.startY;
117 } else {
118 return;
119 }
120 }
121
122 d.distance = tp.y - tp.startY - offset
123 d.pushDragEvent(tp);
124 }
125
126 onReleased: {
127 if (!d.moving) {
128 root.clicked()
129 }
130
131 if (!root.closeable) {
132 animation.animate("center")
133 return;
134 }
135
136 var touchPoint = touchPoints[0];
137
138 if ((d.dragVelocity < -root.minSpeedToClose && d.distance < -units.gu(8)) || d.distance < -root.height / 2) {
139 animation.animate("up")
140 } else if ((d.dragVelocity > root.minSpeedToClose && d.distance > units.gu(8)) || d.distance > root.height / 2) {
141 animation.animate("down")
142 } else {
143 animation.animate("center")
144 }
145 }
146 }
147
148 UbuntuNumberAnimation {
149 id: animation
150 objectName: "closeAnimation"
151 target: d
152 property: "distance"
153 property bool requestClose: false
154
155 function animate(direction) {
156 animation.from = dragArea.distance;
157 switch (direction) {
158 case "up":
159 animation.to = -root.height * 1.5;
160 requestClose = true;
161 break;
162 case "down":
163 animation.to = root.height * 1.5;
164 requestClose = true;
165 break;
166 default:
167 animation.to = 0
168 }
169 animation.start();
170 }
171
172 onRunningChanged: {
173 if (!running) {
174 d.moving = false;
175 if (requestClose) {
176 root.close();
177 } else {
178 d.distance = 0;
179 }
180 }
181 }
182 }
183}
0184
=== added file 'qml/Stage/Spread/SpreadMaths.qml'
--- qml/Stage/Spread/SpreadMaths.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/SpreadMaths.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,78 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Utils 0.1
20import "MathUtils.js" as MathUtils
21
22Item {
23 id: root
24 anchors { left: parent.left; top: parent.top; margins: units.gu(1) }
25
26 // Information about the environment
27 property Item flickable: null
28 property Spread spread: null
29 property int itemIndex: 0
30
31 // Internal
32 property real spreadPosition: itemIndex/spread.visibleItemCount - flickable.contentX/spread.spreadWidth // 0 -> left stack, 1 -> right stack
33 property real leftStackingProgress: MathUtils.clamp(MathUtils.map(spreadPosition, 0, -spread.stackItemCount/spread.visibleItemCount , 0, 1), 0, 1)
34 property real rightStackingProgress: MathUtils.clamp(MathUtils.map(spreadPosition, 1, 1 + spread.stackItemCount/spread.visibleItemCount , 0, 1), 0, 1)
35 property real stackingX: (MathUtils.easeOutCubic(rightStackingProgress) - MathUtils.easeOutCubic(leftStackingProgress)) * spread.stackWidth
36
37
38 QtObject {
39 id: d
40 property real spreadScale: MathUtils.clamp(
41 MathUtils.map(spreadPosition, 0, 1, spread.leftStackScale, spread.rightStackScale),
42 spread.leftStackScale, spread.rightStackScale)
43
44 property real selectedScale: (spread.highlightedIndex == itemIndex ? 1.01 : 1)
45 Behavior on selectedScale { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
46
47 }
48
49 // Output
50 readonly property int targetX: spread.leftStackXPos +
51 spread.spreadWidth * spread.curve.getYFromX(spreadPosition + spread.centeringOffset) +
52 stackingX
53
54 readonly property int targetY: spread.contentTopMargin
55
56 readonly property real targetAngle: MathUtils.clamp(
57 MathUtils.map(targetX, spread.leftStackXPos, spread.rightStackXPos, spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle),
58 Math.min(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle), Math.max(spread.dynamicLeftRotationAngle, spread.dynamicRightRotationAngle))
59
60
61 readonly property real targetScale: d.spreadScale * d.selectedScale
62
63 readonly property real shadowOpacity: 0.2 * (1 - rightStackingProgress) * (1 - leftStackingProgress)
64
65
66 readonly property real closeIconOffset: (targetScale - 1) * (-spread.stackHeight / 2)
67
68 readonly property real tileInfoOpacity: Math.min(MathUtils.clamp(MathUtils.map(leftStackingProgress, 0 , 1/(spread.stackItemCount*3), 1, 0), 0 , 1),
69 MathUtils.clamp(MathUtils.map(spreadPosition, 0.9 , 1, 1, 0), 0 , 1)) /** MathUtils.map(curvedSwitcherProgress, 0.7, 0.9, 0, 1)*/
70
71 readonly property bool itemVisible: {
72 var leftStackHidden = spreadPosition < -(spread.stackItemCount + 1)/spread.visibleItemCount
73 // don't hide the rightmost
74 var rightStackHidden = (spreadPosition > 1 + (spread.stackItemCount)/spread.visibleItemCount) && itemIndex !== spread.totalItemCount - 1
75 return !leftStackHidden && !rightStackHidden
76 }
77
78}
079
=== added file 'qml/Stage/Spread/StagedRightEdgeMaths.qml'
--- qml/Stage/Spread/StagedRightEdgeMaths.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/StagedRightEdgeMaths.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,174 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Unity.Application 0.1
20import "MathUtils.js" as MathUtils
21
22QtObject {
23 id: root
24
25 // Input
26 property int itemIndex: 0
27 property real progress: 0
28 property int sceneWidth: 0
29 property int sideStageWidth: 0
30 property int sceneHeight: 0
31 property int targetX: 0
32 property int startY: 0
33 property int targetY: 0
34 property real startAngle: 30
35 property real targetAngle: 0
36 property int targetHeight: 0
37 property real startScale: 1.3
38 property real targetScale: 0
39 property real breakPoint: units.gu(15) / sceneWidth
40
41 property bool isMainStageApp: false
42 property bool isSideStageApp: false
43 property bool sideStageOpen: false
44 property int nextInStack: 0
45 property int shuffledZ: 0
46
47
48 // Config
49 property int tileDistance: units.gu(10)
50
51 // Output
52
53 readonly property real scaleToPreviewProgress: {
54 return progress < breakPoint ? 0 : MathUtils.clamp(MathUtils.linearAnimation(breakPoint, 1, 0, 1, progress), 0, 1)
55 }
56 readonly property int animatedWidth: {
57 return progress < breakPoint ? root.sceneHeight : MathUtils.linearAnimation(breakPoint, 1, root.sceneWidth, targetHeight, progress)
58 }
59
60 readonly property int animatedHeight: {
61 return progress < breakPoint ? root.sceneHeight : MathUtils.linearAnimation(breakPoint, 1, root.sceneHeight, targetHeight, progress)
62 }
63
64
65 readonly property int animatedX: {
66 var nextStage = appRepeater.itemAt(nextInStack) ? appRepeater.itemAt(nextInStack).stage : ApplicationInfoInterface.MainStage;
67
68 var startX = 0;
69 if (isMainStageApp) {
70 if (progress < breakPoint) {
71 if (nextStage == ApplicationInfoInterface.MainStage) {
72 return MathUtils.linearAnimation(0, breakPoint, 0, -units.gu(4), progress);
73 } else {
74 return 0;
75 }
76 } else {
77 if (nextStage == ApplicationInfoInterface.MainStage) {
78 return MathUtils.linearAnimation(breakPoint, 1, -units.gu(4), targetX, progress);
79 } else {
80 return MathUtils.linearAnimation(breakPoint, 1, 0, targetX, progress);
81 }
82 }
83 } else if (isSideStageApp) {
84 startX = sceneWidth - sideStageWidth;
85 } else if (itemIndex == nextInStack && itemIndex <= 2 && priv.sideStageDelegate && nextStage == ApplicationInfoInterface.MainStage) {
86 startX = sceneWidth - sideStageWidth;
87 } else {
88 var stageCount = (priv.mainStageDelegate ? 1 : 0) + (priv.sideStageDelegate ? 1 : 0)
89 startX = sceneWidth + Math.max(0, itemIndex - stageCount - 1) * tileDistance;
90 }
91
92 if (itemIndex == nextInStack) {
93 if (progress < breakPoint) {
94 return MathUtils.linearAnimation(0, breakPoint, startX, startX * (1 - breakPoint), progress)
95 }
96 return MathUtils.linearAnimation(breakPoint, 1, startX * (1 - breakPoint), targetX, progress)
97 }
98
99 if (progress < breakPoint) {
100 return startX;
101 }
102
103 return MathUtils.linearAnimation(breakPoint, 1, startX, targetX, progress)
104
105 }
106
107 readonly property int animatedY: progress < breakPoint ? startY : MathUtils.linearAnimation(breakPoint, 1, startY, targetY, progress)
108
109 readonly property int animatedZ: {
110 if (progress < breakPoint + (1 - breakPoint) / 2) {
111 return shuffledZ
112 }
113 return itemIndex;
114 }
115
116 readonly property real animatedAngle: {
117 var nextStage = appRepeater.itemAt(nextInStack) ? appRepeater.itemAt(nextInStack).stage : ApplicationInfoInterface.MainStage;
118
119 var startAngle = 0;
120 if (isMainStageApp) {
121 startAngle = 0;
122 } else if (isSideStageApp) {
123 startAngle = 0;
124 } else {
125 if (stage == ApplicationInfoInterface.SideStage && itemIndex == nextInStack && !sideStageOpen) {
126 startAngle = 0;
127 } else {
128 startAngle = root.startAngle;
129 }
130 }
131
132 if ((itemIndex == nextInStack)
133 || (isMainStageApp && nextStage === ApplicationInfoInterface.MainStage)
134 || (isSideStageApp && nextStage === ApplicationInfoInterface.SideStage)) {
135 return MathUtils.linearAnimation(0, 1, startAngle, targetAngle, progress);
136 }
137
138 if (progress < breakPoint) {
139 return 0;
140 }
141 return MathUtils.linearAnimation(breakPoint, 1, startAngle, targetAngle, progress);
142 }
143
144 readonly property real animatedScale: {
145 var pullingInSideStage = itemIndex == nextInStack && stage == ApplicationInfoInterface.SideStage && !sideStageOpen;
146
147 var startScale = 1;
148 if (isMainStageApp) {
149 startScale = 1;
150 } else if (isSideStageApp) {
151 startScale = 1;
152 } else {
153 if (pullingInSideStage) {
154 startScale = 1
155 } else {
156 startScale = root.startScale;
157 }
158 }
159
160 if (progress < breakPoint) {
161 if (itemIndex == nextInStack && (sideStageOpen || stage == ApplicationInfoInterface.MainStage)) {
162 return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress);
163 }
164 return startScale;
165 }
166 if (itemIndex == nextInStack) {
167 return MathUtils.linearAnimation(0, 1, startScale, targetScale, progress)
168 }
169
170 return MathUtils.linearAnimation(breakPoint, 1, startScale, targetScale, progress)
171 }
172
173 readonly property bool itemVisible: true //animatedX < sceneWidth
174}
0175
=== added file 'qml/Stage/Spread/WindowedRightEdgeMaths.qml'
--- qml/Stage/Spread/WindowedRightEdgeMaths.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/WindowedRightEdgeMaths.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,81 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Unity.Application 0.1
20import "MathUtils.js" as MathUtils
21
22QtObject {
23 id: root
24
25 // Input
26 property int itemIndex: 0
27 property int normalZ: 0
28 property real progress: 0
29 property int startWidth: 0
30 property int startHeight: 0
31 property int startX: 0
32 property int targetX: 0
33 property int startY: 0
34 property int targetY: 0
35// property real startAngle: 40
36 property real targetAngle: 0
37 property int targetHeight: 0
38 property real targetScale: 0
39
40 // Config
41 property real breakPoint: 0.4
42
43 // Output
44
45 readonly property real scaleToPreviewProgress: {
46 return progress < breakPoint ? 0 : MathUtils.clamp(MathUtils.linearAnimation(breakPoint, 1, 0, 1, progress), 0, 1)
47 }
48 readonly property int animatedWidth: {
49 return progress < breakPoint ? root.startWidth : MathUtils.linearAnimation(breakPoint, 1, root.startWidth, targetHeight, progress)
50 }
51
52 readonly property int animatedHeight: {
53 return progress < breakPoint ? root.startHeight : MathUtils.linearAnimation(breakPoint, 1, root.startHeight, targetHeight, progress)
54 }
55
56 readonly property int animatedX: {
57 if (progress < breakPoint) {
58 return startX;
59 }
60 return MathUtils.linearAnimation(breakPoint, 1, startX, targetX, progress)
61 }
62
63 readonly property int animatedY: progress < breakPoint ? startY : MathUtils.linearAnimation(breakPoint, 1, startY, targetY, progress)
64
65 readonly property real animatedAngle: progress < breakPoint ? 0 : MathUtils.linearAnimation(breakPoint, 1, 0, targetAngle, progress);
66
67 readonly property real decorationHeight: progress < breakPoint ? 1 : MathUtils.linearAnimation(breakPoint, 1, 1, 0, progress);
68
69 readonly property int animatedZ: {
70 if (progress < breakPoint + (1 - breakPoint) / 2) {
71 return itemIndex == 1 ? normalZ + 2 : normalZ
72 }
73 return itemIndex
74 }
75
76 readonly property real opacityMask: itemIndex == 1 ? MathUtils.linearAnimation(0, breakPoint, 0, 1, progress) : 1
77
78 readonly property real animatedScale: progress < breakPoint ? 1 : MathUtils.linearAnimation(breakPoint, 1, 1, targetScale, progress)
79
80// readonly property bool itemVisible: true //animatedX < sceneWidth
81}
082
=== added file 'qml/Stage/Spread/cubic-bezier.js'
--- qml/Stage/Spread/cubic-bezier.js 1970-01-01 00:00:00 +0000
+++ qml/Stage/Spread/cubic-bezier.js 2016-10-05 14:03:04 +0000
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17//====================================\\
18// 13thParallel.org Beziér Curve Code \\
19// by Dan Pupius (www.pupius.net) \\
20//====================================\\
21
22
23var coord = function (x,y) {
24 if(!x) var x=0;
25 if(!y) var y=0;
26 return {x: x, y: y};
27}
28
29function B4(t) { return t*t*t }
30function B3(t) { return 3*t*t*(1-t) }
31function B2(t) { return 3*t*(1-t)*(1-t) }
32function B1(t) { return (1-t)*(1-t)*(1-t) }
33
34var getBezier = function(percent,C1,C2,C3,C4) {
35 var pos = new coord();
36 pos.x = C1.x*B1(percent) + C2.x*B2(percent) + C3.x*B3(percent) + C4.x*B4(percent);
37 pos.y = C1.y*B1(percent) + C2.y*B2(percent) + C3.y*B3(percent) + C4.y*B4(percent);
38 return pos;
39}
040
=== renamed file 'qml/Stages/DesktopStage.qml' => 'qml/Stage/Stage.qml'
--- qml/Stages/DesktopStage.qml 2016-09-07 08:36:59 +0000
+++ qml/Stage/Stage.qml 2016-10-05 14:03:04 +0000
@@ -22,75 +22,152 @@
22import Utils 0.122import Utils 0.1
23import Ubuntu.Gestures 0.123import Ubuntu.Gestures 0.1
24import GlobalShortcut 1.024import GlobalShortcut 1.0
25import GSettings 1.0
26import "Spread"
27import "Spread/MathUtils.js" as MathUtils
2528
26AbstractStage {29FocusScope {
27 id: root30 id: root
28 anchors.fill: parent31 anchors.fill: parent
29 paintBackground: false32
3033 property QtObject applicationManager
31 // functions to be called from outside34 property QtObject topLevelSurfaceList
32 function updateFocusedAppOrientation() { /* TODO */ }35 property bool altTabPressed
33 function updateFocusedAppOrientationAnimated() { /* TODO */}36 property url background
34 function pushRightEdge(amount) {37 property int dragAreaWidth
35 if (spread.state === "") {38 property bool interactive
36 edgeBarrier.push(amount);39 property bool keepDashRunning: true
37 }40 property real nativeHeight
38 }41 property real nativeWidth
39 function closeFocusedDelegate() {42 property QtObject orientations
40 if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {43 property int shellOrientation
41 priv.focusedAppDelegate.close();44 property int shellOrientationAngle
42 }45 property bool spreadEnabled: true // If false, animations and right edge will be disabled
43 }46 property bool suspended
4447 property int leftMargin: 0
45 // Used by TutorialRight48 property bool oskEnabled: false
46 property bool spreadShown: spread.state == "altTab"49 property rect inputMethodRect
50
51 // Configuration
52 property string mode: "staged"
53 property real leftEdgeDragProgress: 0
54
55 // Used by the tutorial code
56 readonly property bool spreadShown: state == "spread"
57 readonly property real rightEdgeDragProgress: rightEdgeDragArea.progress // How far left the stage has been dragged
4758
48 // used by the snap windows (edge maximize) feature59 // used by the snap windows (edge maximize) feature
49 readonly property alias previewRectangle: fakeRectangle60 readonly property alias previewRectangle: fakeRectangle
5061
51 mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null62 readonly property var mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
5263
53 // application windows never rotate independently64 // application windows never rotate independently
54 mainAppWindowOrientationAngle: shellOrientationAngle65 property int mainAppWindowOrientationAngle: shellOrientationAngle
5566
56 orientationChangesEnabled: true67 property bool orientationChangesEnabled: priv.focusedAppDelegate && priv.focusedAppDelegate.orientationChangesEnabled
5768
5869 property int supportedOrientations: {
59 itemConfiningMouseCursor: !spreadShown && priv.focusedAppDelegate && priv.focusedAppDelegate.surface &&70 if (mainApp) {
71 switch (mode) {
72 case "staged":
73 return mainApp.supportedOrientations;
74 case "stagedWithSideStage":
75 var orientations = mainApp.supportedOrientations;
76 orientations |= Qt.LandscapeOrientation | Qt.InvertedLandscapeOrientation;
77 if (priv.sideStageItemId) {
78 // If we have a sidestage app, support Portrait orientation
79 // so that it will switch the sidestage app to mainstage on rotate to portrait
80 orientations |= Qt.PortraitOrientation|Qt.InvertedPortraitOrientation;
81 }
82 return orientations;
83 }
84 }
85
86 return Qt.PortraitOrientation |
87 Qt.LandscapeOrientation |
88 Qt.InvertedPortraitOrientation |
89 Qt.InvertedLandscapeOrientation;
90 }
91
92
93 onAltTabPressedChanged: priv.goneToSpread = altTabPressed
94
95 property Item itemConfiningMouseCursor: !spreadShown && priv.focusedAppDelegate && priv.focusedAppDelegate.surface &&
60 priv.focusedAppDelegate.surface.confinesMousePointer ?96 priv.focusedAppDelegate.surface.confinesMousePointer ?
61 priv.focusedAppDelegate.clientAreaItem : null;97 priv.focusedAppDelegate.clientAreaItem : null;
6298
99 signal itemSnapshotRequested(Item item)
100
101 // functions to be called from outside
102 function updateFocusedAppOrientation() { /* TODO */ }
103 function updateFocusedAppOrientationAnimated() { /* TODO */}
104 function pushRightEdge(amount) {
105 edgeBarrier.push(amount);
106 }
107
108 onSpreadEnabledChanged: {
109 if (!spreadEnabled && root.state == "spread") {
110 priv.goneToSpread = false;
111 }
112 }
113
114 GSettings {
115 id: lifecycleExceptions
116 schema.id: "com.canonical.qtmir"
117 }
118
119 function isExemptFromLifecycle(appId) {
120 var shortAppId = appId.split('_')[0];
121 for (var i = 0; i < lifecycleExceptions.lifecycleExemptAppids.length; i++) {
122 if (shortAppId === lifecycleExceptions.lifecycleExemptAppids[i]) {
123 return true;
124 }
125 }
126 return false;
127 }
128
129 GlobalShortcut {
130 id: closeFocusedShortcut
131 shortcut: Qt.AltModifier|Qt.Key_F4
132 onTriggered: {
133 if (priv.focusedAppDelegate && !priv.focusedAppDelegate.isDash) {
134 priv.focusedAppDelegate.close();
135 }
136 }
137 }
138
63 GlobalShortcut {139 GlobalShortcut {
64 id: showSpreadShortcut140 id: showSpreadShortcut
65 shortcut: Qt.MetaModifier|Qt.Key_W141 shortcut: Qt.MetaModifier|Qt.Key_W
66 onTriggered: spread.state = "altTab"142 onTriggered: priv.goneToSpread = true
67 }143 }
68144
69 GlobalShortcut {145 GlobalShortcut {
70 id: minimizeAllShortcut146 id: minimizeAllShortcut
71 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_D147 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_D
72 onTriggered: priv.minimizeAllWindows()148 onTriggered: priv.minimizeAllWindows()
149 active: root.state == "windowed"
73 }150 }
74151
75 GlobalShortcut {152 GlobalShortcut {
76 id: maximizeWindowShortcut153 id: maximizeWindowShortcut
77 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up154 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Up
78 onTriggered: priv.focusedAppDelegate.maximize()155 onTriggered: priv.focusedAppDelegate.maximize()
79 active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximized156 active: root.state == "windowed" && priv.focusedAppDelegate && priv.focusedAppDelegate.canBeMaximized
80 }157 }
81158
82 GlobalShortcut {159 GlobalShortcut {
83 id: maximizeWindowLeftShortcut160 id: maximizeWindowLeftShortcut
84 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Left161 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Left
85 onTriggered: priv.focusedAppDelegate.maximizeLeft()162 onTriggered: priv.focusedAppDelegate.maximizeLeft()
86 active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximizedLeftRight163 active: root.state == "windowed" && priv.focusedAppDelegate && priv.focusedAppDelegate.canBeMaximizedLeftRight
87 }164 }
88165
89 GlobalShortcut {166 GlobalShortcut {
90 id: maximizeWindowRightShortcut167 id: maximizeWindowRightShortcut
91 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Right168 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Right
92 onTriggered: priv.focusedAppDelegate.maximizeRight()169 onTriggered: priv.focusedAppDelegate.maximizeRight()
93 active: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.canBeMaximizedLeftRight170 active: root.state == "windowed" && priv.focusedAppDelegate && priv.focusedAppDelegate.canBeMaximizedLeftRight
94 }171 }
95172
96 GlobalShortcut {173 GlobalShortcut {
@@ -98,7 +175,7 @@
98 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Down175 shortcut: Qt.MetaModifier|Qt.ControlModifier|Qt.Key_Down
99 onTriggered: priv.focusedAppDelegate.anyMaximized176 onTriggered: priv.focusedAppDelegate.anyMaximized
100 ? priv.focusedAppDelegate.restoreFromMaximized() : priv.focusedAppDelegate.minimize()177 ? priv.focusedAppDelegate.restoreFromMaximized() : priv.focusedAppDelegate.minimize()
101 active: priv.focusedAppDelegate !== null178 active: root.state == "windowed" && priv.focusedAppDelegate
102 }179 }
103180
104 GlobalShortcut {181 GlobalShortcut {
@@ -107,28 +184,17 @@
107 active: priv.focusedAppDelegate !== null184 active: priv.focusedAppDelegate !== null
108 }185 }
109186
110 Connections {
111 target: root.topLevelSurfaceList
112 onCountChanged: {
113 if (spread.state == "altTab") {
114 spread.cancel();
115 }
116 }
117 }
118
119 QtObject {187 QtObject {
120 id: priv188 id: priv
121 objectName: "DesktopStagePrivate"189 objectName: "DesktopStagePrivate"
122190
123 property var focusedAppDelegate: null191 property var focusedAppDelegate: null
124 onFocusedAppDelegateChanged: {
125 if (spread.state == "altTab") {
126 spread.state = "";
127 }
128 }
129
130 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel192 property var foregroundMaximizedAppDelegate: null // for stuff like drop shadow and focusing maximized app by clicking panel
131193
194 property bool goneToSpread: false
195 property int closingIndex: -1
196 property int animationDuration: UbuntuAnimation.FastDuration
197
132 function updateForegroundMaximizedApp() {198 function updateForegroundMaximizedApp() {
133 var found = false;199 var found = false;
134 for (var i = 0; i < appRepeater.count && !found; i++) {200 for (var i = 0; i < appRepeater.count && !found; i++) {
@@ -162,11 +228,87 @@
162 }228 }
163 }229 }
164230
165 readonly property real virtualKeyboardHeight: SurfaceManager.inputMethodSurface231 readonly property bool sideStageEnabled: root.mode === "stagedWithSideStage" &&
166 ? SurfaceManager.inputMethodSurface.inputBounds.height232 (root.shellOrientation == Qt.LandscapeOrientation ||
167 : 0233 root.shellOrientation == Qt.InvertedLandscapeOrientation)
234
235 property var mainStageDelegate: null
236 property var sideStageDelegate: null
237 property int mainStageItemId: 0
238 property int sideStageItemId: 0
239 property string mainStageAppId: ""
240 property string sideStageAppId: ""
241
242 onSideStageDelegateChanged: {
243 if (!sideStageDelegate) {
244 sideStage.hide();
245 }
246 }
247
248 function updateMainAndSideStageIndexes() {
249 if (root.mode != "stagedWithSideStage") {
250 priv.sideStageDelegate = null;
251 priv.sideStageItemId = 0;
252 priv.sideStageAppId = "";
253 priv.mainStageDelegate = appRepeater.itemAt(0);
254 priv.mainStageAppId = topLevelSurfaceList.idAt(0);
255 priv.mainStageAppId = topLevelSurfaceList.applicationAt(0) ? topLevelSurfaceList.applicationAt(0).appId : ""
256 return;
257 }
258
259 var choseMainStage = false;
260 var choseSideStage = false;
261
262 if (!root.topLevelSurfaceList)
263 return;
264
265 for (var i = 0; i < appRepeater.count && (!choseMainStage || !choseSideStage); ++i) {
266 var appDelegate = appRepeater.itemAt(i);
267 if (sideStage.shown && appDelegate.stage == ApplicationInfoInterface.SideStage
268 && !choseSideStage) {
269 priv.sideStageDelegate = appDelegate
270 priv.sideStageItemId = root.topLevelSurfaceList.idAt(i);
271 priv.sideStageAppId = root.topLevelSurfaceList.applicationAt(i).appId;
272 choseSideStage = true;
273 } else if (!choseMainStage && appDelegate.stage == ApplicationInfoInterface.MainStage) {
274 priv.mainStageDelegate = appDelegate;
275 priv.mainStageItemId = root.topLevelSurfaceList.idAt(i);
276 priv.mainStageAppId = root.topLevelSurfaceList.applicationAt(i).appId;
277 choseMainStage = true;
278 }
279 }
280 if (!choseMainStage && priv.mainStageDelegate) {
281 priv.mainStageDelegate = null;
282 priv.mainStageItemId = 0;
283 priv.mainStageAppId = "";
284 }
285 if (!choseSideStage && priv.sideStageDelegate) {
286 priv.sideStageDelegate = null;
287 priv.sideStageItemId = 0;
288 priv.sideStageAppId = "";
289 }
290 }
291
292 property int nextInStack: {
293 var mainStageIndex = priv.mainStageDelegate ? priv.mainStageDelegate.itemIndex : -1;
294 var sideStageIndex = priv.sideStageDelegate ? priv.sideStageDelegate.itemIndex : -1;
295 if (sideStageIndex == -1) {
296 return topLevelSurfaceList.count > 1 ? 1 : -1;
297 }
298 if (mainStageIndex == 0 || sideStageIndex == 0) {
299 if (mainStageIndex == 1 || sideStageIndex == 1) {
300 return topLevelSurfaceList.count > 2 ? 2 : -1;
301 }
302 return 1;
303 }
304 return -1;
305 }
306
307 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
168 }308 }
169309
310 Component.onCompleted: priv.updateMainAndSideStageIndexes();
311
170 Connections {312 Connections {
171 target: PanelState313 target: PanelState
172 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }314 onCloseClicked: { if (priv.focusedAppDelegate) { priv.focusedAppDelegate.close(); } }
@@ -178,14 +320,13 @@
178 target: PanelState320 target: PanelState
179 property: "buttonsVisible"321 property: "buttonsVisible"
180 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus322 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.maximized // FIXME for Locally integrated menus
181 && spread.state == ""
182 }323 }
183324
184 Binding {325 Binding {
185 target: PanelState326 target: PanelState
186 property: "title"327 property: "title"
187 value: {328 value: {
188 if (priv.focusedAppDelegate !== null && spread.state == "") {329 if (priv.focusedAppDelegate !== null) {
189 if (priv.focusedAppDelegate.maximized)330 if (priv.focusedAppDelegate.maximized)
190 return priv.focusedAppDelegate.title331 return priv.focusedAppDelegate.title
191 else332 else
@@ -199,7 +340,7 @@
199 Binding {340 Binding {
200 target: PanelState341 target: PanelState
201 property: "dropShadow"342 property: "dropShadow"
202 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null343 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppDelegate !== null && mode == "windowed"
203 }344 }
204345
205 Binding {346 Binding {
@@ -216,16 +357,34 @@
216357
217 Instantiator {358 Instantiator {
218 model: root.applicationManager359 model: root.applicationManager
219 delegate: Binding {360 delegate: QtObject {
220 target: model.application361 property var stateBinding: Binding {
221 property: "requestedState"362 readonly property bool isDash: model.application ? model.application.appId == "unity8-dash" : false
222363 target: model.application
223 // TODO: figure out some lifecycle policy, like suspending minimized apps364 property: "requestedState"
224 // if running on a tablet or something.365
225 // TODO: If the device has a dozen suspended apps because it was running366 // TODO: figure out some lifecycle policy, like suspending minimized apps
226 // in staged mode, when it switches to Windowed mode it will suddenly367 // or something if running windowed.
227 // resume all those apps at once. We might want to avoid that.368 // TODO: If the device has a dozen suspended apps because it was running
228 value: ApplicationInfoInterface.RequestedRunning // Always running for now369 // in staged mode, when it switches to Windowed mode it will suddenly
370 // resume all those apps at once. We might want to avoid that.
371 value: root.mode === "windowed"
372 || (isDash && root.keepDashRunning)
373 || (!root.suspended && model.application && priv.focusedAppDelegate &&
374 (priv.focusedAppDelegate.appId === model.application.appId ||
375 priv.mainStageAppId === model.application.appId ||
376 priv.sideStageAppId === model.application.appId))
377 ? ApplicationInfoInterface.RequestedRunning
378 : ApplicationInfoInterface.RequestedSuspended
379 }
380
381 property var lifecycleBinding: Binding {
382 target: model.application
383 property: "exemptFromLifecycle"
384 value: model.application
385 ? (!model.application.isTouchApp || isExemptFromLifecycle(model.application.appId))
386 : false
387 }
229 }388 }
230 }389 }
231390
@@ -236,16 +395,203 @@
236 when: !appRepeater.startingUp && root.parent395 when: !appRepeater.startingUp && root.parent
237 }396 }
238397
398 states: [
399 State {
400 name: "spread"; when: priv.goneToSpread
401 PropertyChanges { target: floatingFlickable; enabled: true }
402 PropertyChanges { target: spreadItem; focus: true }
403 PropertyChanges { target: hoverMouseArea; enabled: true }
404 PropertyChanges { target: rightEdgeDragArea; enabled: false }
405 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
406 },
407 State {
408 name: "stagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "staged"
409 },
410 State {
411 name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "stagedWithSideStage"
412 PropertyChanges {
413 target: sideStage
414 opacity: priv.sideStageDelegate.x === sideStage.x ? 1 : 0
415 visible: true
416 }
417 },
418 State {
419 name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "windowed"
420 },
421 State {
422 name: "staged"; when: root.mode === "staged"
423 },
424 State {
425 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
426 PropertyChanges { target: triGestureArea; enabled: true }
427 PropertyChanges { target: sideStage; visible: true }
428 },
429 State {
430 name: "windowed"; when: root.mode === "windowed"
431 }
432 ]
433 transitions: [
434 Transition {
435 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
436 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
437 },
438 Transition {
439 to: "spread"
440 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: appRepeater.count > 1 ? 1 : 0 }
441 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
442 },
443 Transition {
444 from: "spread"
445 SequentialAnimation {
446 ScriptAction {
447 script: {
448 var item = appRepeater.itemAt(Math.max(0, spreadItem.highlightedIndex));
449 if (item.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
450 sideStage.show();
451 }
452 item.playFocusAnimation();
453 }
454 }
455 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
456 }
457 },
458 Transition {
459 to: "stagedRightEdge"
460 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
461 },
462 Transition {
463 to: "stagedWithSideStage"
464 ScriptAction { script: priv.updateMainAndSideStageIndexes(); }
465 }
466
467 ]
468
469 MouseArea {
470 id: cancelSpreadMouseArea
471 anchors.fill: parent
472 enabled: false
473 onClicked: priv.goneToSpread = false
474 }
475
239 FocusScope {476 FocusScope {
240 id: appContainer477 id: appContainer
241 objectName: "appContainer"478 objectName: "appContainer"
242 anchors.fill: parent479 anchors.fill: parent
243 focus: spread.state !== "altTab"480 focus: true
244481
245 Wallpaper {482 Wallpaper {
246 id: wallpaper483 id: wallpaper
247 anchors.fill: parent484 anchors.fill: parent
248 source: root.background485 source: root.background
486 // Make sure it's the lowest item. Due to the left edge drag we sometimes need
487 // to put the dash at -1 and we don't want it behind the Wallpaper
488 z: -2
489 }
490
491 Spread {
492 id: spreadItem
493 objectName: "spreadItem"
494 anchors.fill: appContainer
495 leftMargin: root.leftMargin
496 model: root.topLevelSurfaceList
497 spreadFlickable: floatingFlickable
498 z: 10
499
500 onLeaveSpread: {
501 priv.goneToSpread = false;
502 }
503 }
504
505 Connections {
506 target: root.topLevelSurfaceList
507 onListChanged: priv.updateMainAndSideStageIndexes()
508 }
509
510
511 DropArea {
512 objectName: "MainStageDropArea"
513 anchors {
514 left: parent.left
515 top: parent.top
516 bottom: parent.bottom
517 }
518 width: appContainer.width - sideStage.width
519 enabled: sideStage.enabled
520
521 onDropped: {
522 drop.source.appDelegate.saveStage(ApplicationInfoInterface.MainStage);
523 drop.source.appDelegate.focus = true;
524 }
525 keys: "SideStage"
526 }
527
528 SideStage {
529 id: sideStage
530 objectName: "sideStage"
531 shown: false
532 height: appContainer.height
533 x: appContainer.width - width
534 visible: false
535 Behavior on opacity { UbuntuNumberAnimation {} }
536 z: {
537 if (!priv.mainStageItemId) return 0;
538
539 if (priv.sideStageItemId && priv.nextInStack > 0) {
540
541 // Due the order in which bindings are evaluated, this might be triggered while shuffling
542 // the list and index doesn't yet match with itemIndex (even though itemIndex: index)
543 // Let's walk the list and compare itemIndex to make sure we have the correct one.
544 var nextDelegateInStack = -1;
545 for (var i = 0; i < appRepeater.count; i++) {
546 if (appRepeater.itemAt(i).itemIndex == priv.nextInStack) {
547 nextDelegateInStack = appRepeater.itemAt(i);
548 break;
549 }
550 }
551
552 if (nextDelegateInStack.stage === ApplicationInfoInterface.MainStage) {
553 // if the next app in stack is a main stage app, put the sidestage on top of it.
554 return 2;
555 }
556 return 1;
557 }
558
559 return 1;
560 }
561
562 onShownChanged: {
563 if (!shown && priv.mainStageDelegate) {
564 priv.mainStageDelegate.claimFocus();
565 }
566 }
567
568 DropArea {
569 id: sideStageDropArea
570 objectName: "SideStageDropArea"
571 anchors.fill: parent
572
573 property bool dropAllowed: true
574
575 onEntered: {
576 dropAllowed = drag.keys != "Disabled";
577 }
578 onExited: {
579 dropAllowed = true;
580 }
581 onDropped: {
582 if (drop.keys == "MainStage") {
583 drop.source.appDelegate.saveStage(ApplicationInfoInterface.SideStage);
584 drop.source.appDelegate.focus = true;
585 }
586 }
587 drag {
588 onSourceChanged: {
589 if (!sideStageDropArea.drag.source) {
590 dropAllowed = true;
591 }
592 }
593 }
594 }
249 }595 }
250596
251 TopLevelSurfaceRepeater {597 TopLevelSurfaceRepeater {
@@ -256,6 +602,7 @@
256 delegate: FocusScope {602 delegate: FocusScope {
257 id: appDelegate603 id: appDelegate
258 objectName: "appDelegate_" + model.id604 objectName: "appDelegate_" + model.id
605 property int itemIndex: index // We need this from outside the repeater
259 // z might be overriden in some cases by effects, but we need z ordering606 // z might be overriden in some cases by effects, but we need z ordering
260 // to calculate occlusion detection607 // to calculate occlusion detection
261 property int normalZ: topLevelSurfaceList.count - index608 property int normalZ: topLevelSurfaceList.count - index
@@ -265,10 +612,33 @@
265 }612 }
266 }613 }
267 z: normalZ614 z: normalZ
268 x: requestedX // may be overridden in some states. Do not directly write to this.615
269 y: requestedY // may be overridden in some states. Do not directly write to this.616 // Normally we want x/y where we request it to be. Width/height of our delegate will
270 property real requestedX: priv.focusedAppDelegate ? priv.focusedAppDelegate.x + units.gu(3) : (normalZ - 1) * units.gu(3)617 // match what the actual surface size is.
271 property real requestedY: priv.focusedAppDelegate ? priv.focusedAppDelegate.y + units.gu(3) : normalZ * units.gu(3)618 // Don't write to those, they will be set by states
619 x: requestedX
620 y: requestedY
621 width: decoratedWindow.implicitWidth
622 height: decoratedWindow.implicitHeight
623
624 // requestedX/Y/width/height is what we ask the actual surface to be.
625 // Do not write to those, they will be set by states
626 property real requestedX: windowedX
627 property real requestedY: windowedY
628 property real requestedWidth: windowedWidth
629 property real requestedHeight: windowedHeight
630
631 // In those are for windowed mode. Those values basically store the window's properties
632 // when having a floating window. If you want to move/resize a window in normal mode, this is what you want to write to.
633 property real windowedX
634 property real windowedY
635 property real windowedWidth
636 property real windowedHeight
637
638 // unlike windowedX/Y, this is the last known grab position before being pushed against edges/corners
639 // when restoring, the window should return to these, not to the place where it was dropped near the edge
640 property real restoredX
641 property real restoredY
272642
273 Binding {643 Binding {
274 target: appDelegate644 target: appDelegate
@@ -277,27 +647,24 @@
277 Math.min(appDelegate.requestedY - PanelState.panelHeight,647 Math.min(appDelegate.requestedY - PanelState.panelHeight,
278 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))648 Math.max(0, priv.virtualKeyboardHeight - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
279 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")649 when: root.oskEnabled && appDelegate.focus && (appDelegate.state == "normal" || appDelegate.state == "restored")
280 && SurfaceManager.inputMethodSurface650 && root.inputMethodRect.height > 0
281 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
282 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
283651
284 }652 }
285653
286 width: decoratedWindow.width654 Behavior on x { id: xBehavior; enabled: priv.closingIndex >= 0; UbuntuNumberAnimation { onRunningChanged: if (!running) priv.closingIndex = -1} }
287 height: decoratedWindow.height
288655
289 Connections {656 Connections {
290 target: root657 target: root
291 onShellOrientationAngleChanged: {658 onShellOrientationAngleChanged: {
292 // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle659 // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle
293 if (application && application.rotatesWindowContents) {660 if (application && application.rotatesWindowContents) {
294 if (state == "normal" || state == "restored") {661 if (root.state == "windowed") {
295 var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;662 var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;
296 angleDiff = (360 + angleDiff) % 360;663 angleDiff = (360 + angleDiff) % 360;
297 if (angleDiff === 90 || angleDiff === 270) {664 if (angleDiff === 90 || angleDiff === 270) {
298 var aux = decoratedWindow.requestedHeight;665 var aux = decoratedWindow.requestedHeight;
299 decoratedWindow.requestedHeight = decoratedWindow.requestedWidth + decoratedWindow.visibleDecorationHeight;666 decoratedWindow.requestedHeight = decoratedWindow.requestedWidth + decoratedWindow.decorationHeight;
300 decoratedWindow.requestedWidth = aux - decoratedWindow.visibleDecorationHeight;667 decoratedWindow.requestedWidth = aux - decoratedWindow.decorationHeight;
301 }668 }
302 }669 }
303 decoratedWindow.surfaceOrientationAngle = shellOrientationAngle;670 decoratedWindow.surfaceOrientationAngle = shellOrientationAngle;
@@ -306,6 +673,10 @@
306 }673 }
307 }674 }
308 }675 }
676 Connections {
677 target: priv
678 onSideStageEnabledChanged: refreshStage()
679 }
309680
310 readonly property alias application: decoratedWindow.application681 readonly property alias application: decoratedWindow.application
311 readonly property alias minimumWidth: decoratedWindow.minimumWidth682 readonly property alias minimumWidth: decoratedWindow.minimumWidth
@@ -314,8 +685,6 @@
314 readonly property alias maximumHeight: decoratedWindow.maximumHeight685 readonly property alias maximumHeight: decoratedWindow.maximumHeight
315 readonly property alias widthIncrement: decoratedWindow.widthIncrement686 readonly property alias widthIncrement: decoratedWindow.widthIncrement
316 readonly property alias heightIncrement: decoratedWindow.heightIncrement687 readonly property alias heightIncrement: decoratedWindow.heightIncrement
317 property int requestedWidth: -1
318 property int requestedHeight: -1
319688
320 readonly property bool maximized: windowState === WindowStateStorage.WindowStateMaximized689 readonly property bool maximized: windowState === WindowStateStorage.WindowStateMaximized
321 readonly property bool maximizedLeft: windowState === WindowStateStorage.WindowStateMaximizedLeft690 readonly property bool maximizedLeft: windowState === WindowStateStorage.WindowStateMaximizedLeft
@@ -330,7 +699,7 @@
330 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight699 maximizedTopLeft || maximizedTopRight || maximizedBottomLeft || maximizedBottomRight
331700
332 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized701 readonly property bool minimized: windowState & WindowStateStorage.WindowStateMinimized
333 readonly property alias fullscreen: decoratedWindow.fullscreen702 readonly property bool fullscreen: surface ? surface.state === Mir.FullscreenState : application.fullscreen
334703
335 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically704 readonly property bool canBeMaximized: canBeMaximizedHorizontally && canBeMaximizedVertically
336 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&705 readonly property bool canBeMaximizedLeftRight: (maximumWidth == 0 || maximumWidth >= appContainer.width/2) &&
@@ -339,6 +708,7 @@
339 (maximumHeight == 0 || maximumHeight >= appContainer.height/2)708 (maximumHeight == 0 || maximumHeight >= appContainer.height/2)
340 readonly property bool canBeMaximizedHorizontally: maximumWidth == 0 || maximumWidth >= appContainer.width709 readonly property bool canBeMaximizedHorizontally: maximumWidth == 0 || maximumWidth >= appContainer.width
341 readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height710 readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height
711 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled
342712
343 property int windowState: WindowStateStorage.WindowStateNormal713 property int windowState: WindowStateStorage.WindowStateNormal
344 property bool animationsEnabled: true714 property bool animationsEnabled: true
@@ -347,23 +717,45 @@
347 property bool visuallyMaximized: false717 property bool visuallyMaximized: false
348 property bool visuallyMinimized: false718 property bool visuallyMinimized: false
349719
720 property int stage: ApplicationInfoInterface.MainStage
721 function saveStage(newStage) {
722 appDelegate.stage = newStage;
723 WindowStateStorage.saveStage(appId, newStage);
724 priv.updateMainAndSideStageIndexes()
725 }
726
350 readonly property var surface: model.surface727 readonly property var surface: model.surface
351 readonly property alias resizeArea: resizeArea728 readonly property alias resizeArea: resizeArea
352 readonly property alias focusedSurface: decoratedWindow.focusedSurface729 readonly property alias focusedSurface: decoratedWindow.focusedSurface
353 readonly property bool dragging: touchControls.overlayShown ? touchControls.dragging : decoratedWindow.dragging730 readonly property bool dragging: touchControls.overlayShown ? touchControls.dragging : decoratedWindow.dragging
354731
355 readonly property bool isDash: model.application.appId == "unity8-dash"732 readonly property string appId: model.application.appId
733 readonly property bool isDash: appId == "unity8-dash"
356 readonly property alias clientAreaItem: decoratedWindow.clientAreaItem734 readonly property alias clientAreaItem: decoratedWindow.clientAreaItem
357735
358 function claimFocus() {736 function claimFocus() {
359 if (spread.state == "altTab") {737 if (root.state == "spread") {
360 spread.cancel();738 spreadItem.highlightedIndex = index
361 }739 priv.goneToSpread = false;
362 appDelegate.restore(true /* animated */, appDelegate.windowState);740 }
741 if (root.mode == "stagedWithSideStage") {
742 if (appDelegate.stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
743 sideStage.show();
744 }
745 priv.updateMainAndSideStageIndexes();
746 }
747
748 if (root.mode == "windowed") {
749 appDelegate.restore(true /* animated */, appDelegate.windowState);
750 } else {
751 appDelegate.focus = true;
752 }
363 }753 }
364 Connections {754 Connections {
365 target: model.surface755 target: model.surface
366 onFocusRequested: claimFocus();756 onFocusRequested: {
757 claimFocus();
758 }
367 }759 }
368 Connections {760 Connections {
369 target: model.application761 target: model.application
@@ -383,14 +775,9 @@
383 return;775 return;
384776
385 if (focus) {777 if (focus) {
386 // If we're orphan (!parent) it means this stage is no longer the current one778 topLevelSurfaceList.raiseId(model.id);
387 // and will be deleted shortly. So we should no longer have a say over the model
388 if (root.parent) {
389 topLevelSurfaceList.raiseId(model.id);
390 }
391
392 priv.focusedAppDelegate = appDelegate;779 priv.focusedAppDelegate = appDelegate;
393 } else if (!focus && priv.focusedAppDelegate === appDelegate) {780 } else if (!focus && priv.focusedAppDelegate === appDelegate && root.state != "spread") {
394 priv.focusedAppDelegate = null;781 priv.focusedAppDelegate = null;
395 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null782 // FIXME: No idea why the Binding{} doens't update when focusedAppDelegate turns null
396 MirFocusController.focusedSurface = null;783 MirFocusController.focusedSurface = null;
@@ -403,13 +790,25 @@
403 decoratedWindow.surfaceOrientationAngle = 0;790 decoratedWindow.surfaceOrientationAngle = 0;
404 }791 }
405792
793 // First, cascade the newly created window, relative to the currently/old focused window.
794 windowedX = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedX + units.gu(3) : (normalZ - 1) * units.gu(3)
795 windowedY = priv.focusedAppDelegate ? priv.focusedAppDelegate.windowedY + units.gu(3) : normalZ * units.gu(3)
796 // Now load any saved state. This needs to happen *after* the cascading!
797 resizeArea.loadWindowState();
798
406 // NB: We're differentiating if this delegate was created in response to a new entry in the model799 // NB: We're differentiating if this delegate was created in response to a new entry in the model
407 // or if the Repeater is just populating itself with delegates to match the model it received.800 // or if the Repeater is just populating itself with delegates to match the model it received.
408 if (!appRepeater.startingUp) {801 if (!appRepeater.startingUp) {
409 // a top level window is always the focused one when it first appears, unfocusing802 // a top level window is always the focused one when it first appears, unfocusing
410 // any preexisting one803 // any preexisting one
411 focus = true;804 if (root.state == "spread") {
805 spreadItem.highlightedIndex = index;
806 }
807 claimFocus();
412 }808 }
809
810 refreshStage();
811 _constructing = false;
413 }812 }
414 Component.onDestruction: {813 Component.onDestruction: {
415 if (!root.parent) {814 if (!root.parent) {
@@ -435,13 +834,20 @@
435834
436 onVisuallyMaximizedChanged: priv.updateForegroundMaximizedApp()835 onVisuallyMaximizedChanged: priv.updateForegroundMaximizedApp()
437836
837 property bool _constructing: true;
838 onStageChanged: {
839 if (!_constructing) {
840 priv.updateMainAndSideStageIndexes();
841 }
842 }
843
438 visible: (844 visible: (
439 !visuallyMinimized845 !visuallyMinimized
440 && !greeter.fullyShown846 && !greeter.fullyShown
441 && (priv.foregroundMaximizedAppDelegate === null || priv.foregroundMaximizedAppDelegate.normalZ <= z)847 && (priv.foregroundMaximizedAppDelegate === null || priv.foregroundMaximizedAppDelegate.normalZ <= z)
442 )848 )
443 || decoratedWindow.fullscreen849 || appDelegate.fullscreen
444 || (spread.state == "altTab" && index === spread.highlightedIndex)850 || focusAnimation.running || rightEdgeFocusAnimation.running || hidingAnimation.running
445851
446 function close() {852 function close() {
447 model.surface.close();853 model.surface.close();
@@ -499,7 +905,44 @@
499 }905 }
500906
501 function playFocusAnimation() {907 function playFocusAnimation() {
502 focusAnimation.start()908 if (state == "stagedRightEdge") {
909 // TODO: Can we drop this if and find something that always works?
910 if (root.mode == "staged") {
911 rightEdgeFocusAnimation.targetX = 0
912 rightEdgeFocusAnimation.start()
913 } else if (root.mode == "stagedWithSideStage") {
914 rightEdgeFocusAnimation.targetX = appDelegate.stage == ApplicationInfoInterface.SideStage ? sideStage.x : 0
915 rightEdgeFocusAnimation.start()
916 }
917 } else if (state == "windowedRightEdge" || state == "windowed") {
918 claimFocus();
919 } else {
920 focusAnimation.start()
921 }
922 }
923 function playHidingAnimation() {
924 if (state != "windowedRightEdge") {
925 hidingAnimation.start()
926 }
927 }
928
929 function refreshStage() {
930 var newStage = ApplicationInfoInterface.MainStage;
931 if (priv.sideStageEnabled) { // we're in lanscape rotation.
932 if (!isDash && application && application.supportedOrientations & (Qt.PortraitOrientation|Qt.InvertedPortraitOrientation)) {
933 var defaultStage = ApplicationInfoInterface.SideStage; // if application supports portrait, it defaults to sidestage.
934 if (application.supportedOrientations & (Qt.LandscapeOrientation|Qt.InvertedLandscapeOrientation)) {
935 // if it supports lanscape, it defaults to mainstage.
936 defaultStage = ApplicationInfoInterface.MainStage;
937 }
938 newStage = WindowStateStorage.getStage(application.appId, defaultStage);
939 }
940 }
941
942 stage = newStage;
943 if (focus && stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
944 sideStage.show();
945 }
503 }946 }
504947
505 UbuntuNumberAnimation {948 UbuntuNumberAnimation {
@@ -509,32 +952,255 @@
509 from: 0.98952 from: 0.98
510 to: 1953 to: 1
511 duration: UbuntuAnimation.SnapDuration954 duration: UbuntuAnimation.SnapDuration
512 }955 onStarted: {
513956 topLevelSurfaceList.raiseId(model.id);
514 // unlike requestedX/Y, this is the last known grab position before being pushed against edges/corners957 }
515 // when restoring, the window should return to these, not to the place where it was dropped near the edge958 onStopped: {
516 property real restoredX959 appDelegate.claimFocus();
517 property real restoredY960 }
961 }
962 ParallelAnimation {
963 id: rightEdgeFocusAnimation
964 property int targetX: 0
965 UbuntuNumberAnimation { target: appDelegate; properties: "x"; to: rightEdgeFocusAnimation.targetX; duration: priv.animationDuration }
966 UbuntuNumberAnimation { target: decoratedWindow; properties: "angle"; to: 0; duration: priv.animationDuration }
967 UbuntuNumberAnimation { target: decoratedWindow; properties: "itemScale"; to: 1; duration: priv.animationDuration }
968 onStopped: {
969 appDelegate.focus = true
970 }
971 }
972 ParallelAnimation {
973 id: hidingAnimation
974 UbuntuNumberAnimation { target: appDelegate; property: "opacity"; to: 0; duration: priv.animationDuration }
975 onStopped: appDelegate.opacity = 1
976 }
977
978 SpreadMaths {
979 id: spreadMaths
980 spread: spreadItem
981 itemIndex: index
982 flickable: floatingFlickable
983 }
984 StageMaths {
985 id: stageMaths
986 sceneWidth: root.width
987 stage: appDelegate.stage
988 thisDelegate: appDelegate
989 mainStageDelegate: priv.mainStageDelegate
990 sideStageDelegate: priv.sideStageDelegate
991 sideStageWidth: sideStage.panelWidth
992 sideStageX: sideStage.x
993 itemIndex: appDelegate.itemIndex
994 nextInStack: priv.nextInStack
995 leftEdgeDragProgress: root.leftEdgeDragProgress
996 }
997
998 StagedRightEdgeMaths {
999 id: stagedRightEdgeMaths
1000 sceneWidth: appContainer.width - root.leftMargin
1001 sceneHeight: appContainer.height
1002 isMainStageApp: priv.mainStageDelegate == appDelegate
1003 isSideStageApp: priv.sideStageDelegate == appDelegate
1004 sideStageWidth: sideStage.width
1005 sideStageOpen: sideStage.shown
1006 itemIndex: index
1007 nextInStack: priv.nextInStack
1008 progress: 0
1009 targetHeight: spreadItem.stackHeight
1010 targetX: spreadMaths.targetX
1011 startY: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1012 targetY: spreadMaths.targetY
1013 targetAngle: spreadMaths.targetAngle
1014 targetScale: spreadMaths.targetScale
1015 shuffledZ: stageMaths.itemZ
1016 breakPoint: spreadItem.rightEdgeBreakPoint
1017 }
1018
1019 WindowedRightEdgeMaths {
1020 id: windowedRightEdgeMaths
1021 itemIndex: index
1022 startWidth: appDelegate.requestedWidth
1023 startHeight: appDelegate.requestedHeight
1024 targetHeight: spreadItem.stackHeight
1025 targetX: spreadMaths.targetX
1026 targetY: spreadMaths.targetY
1027 normalZ: appDelegate.normalZ
1028 targetAngle: spreadMaths.targetAngle
1029 targetScale: spreadMaths.targetScale
1030 breakPoint: spreadItem.rightEdgeBreakPoint
1031 }
5181032
519 states: [1033 states: [
520 State {1034 State {
1035 name: "spread"; when: root.state == "spread"
1036 PropertyChanges {
1037 target: decoratedWindow;
1038 showDecoration: false;
1039 angle: spreadMaths.targetAngle
1040 itemScale: spreadMaths.targetScale
1041 scaleToPreviewSize: spreadItem.stackHeight
1042 scaleToPreviewProgress: 1
1043 hasDecoration: root.mode === "windowed"
1044 shadowOpacity: spreadMaths.shadowOpacity
1045 showHighlight: spreadItem.highlightedIndex === index
1046 darkening: spreadItem.highlightedIndex >= 0
1047 anchors.topMargin: dragArea.distance
1048 }
1049 PropertyChanges {
1050 target: appDelegate
1051 x: spreadMaths.targetX
1052 y: spreadMaths.targetY
1053 z: index
1054 height: spreadItem.spreadItemHeight
1055 requestedWidth: decoratedWindow.oldRequestedWidth
1056 requestedHeight: decoratedWindow.oldRequestedHeight
1057 visible: spreadMaths.itemVisible
1058 }
1059 PropertyChanges { target: dragArea; enabled: true }
1060 PropertyChanges { target: windowInfoItem; opacity: spreadMaths.tileInfoOpacity; visible: spreadMaths.itemVisible }
1061 },
1062 State {
1063 name: "stagedRightEdge"
1064 when: (root.mode == "staged" || root.mode == "stagedWithSideStage") && (root.state == "sideStagedRightEdge" || root.state == "stagedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running)
1065 PropertyChanges {
1066 target: stagedRightEdgeMaths
1067 progress: Math.max(edgeBarrier.progress, rightEdgeDragArea.draggedProgress)
1068 }
1069 PropertyChanges {
1070 target: appDelegate
1071 x: stagedRightEdgeMaths.animatedX
1072 y: stagedRightEdgeMaths.animatedY
1073 z: stagedRightEdgeMaths.animatedZ
1074 height: stagedRightEdgeMaths.animatedHeight
1075 requestedWidth: decoratedWindow.oldRequestedWidth
1076 requestedHeight: decoratedWindow.oldRequestedHeight
1077 visible: appDelegate.x < root.width
1078 }
1079 PropertyChanges {
1080 target: decoratedWindow
1081 hasDecoration: false
1082 angle: stagedRightEdgeMaths.animatedAngle
1083 itemScale: stagedRightEdgeMaths.animatedScale
1084 scaleToPreviewSize: spreadItem.stackHeight
1085 scaleToPreviewProgress: stagedRightEdgeMaths.scaleToPreviewProgress
1086 shadowOpacity: .3
1087 }
1088 },
1089 State {
1090 name: "windowedRightEdge"
1091 when: root.mode == "windowed" && (root.state == "windowedRightEdge" || rightEdgeFocusAnimation.running || hidingAnimation.running || edgeBarrier.progress > 0)
1092 PropertyChanges {
1093 target: windowedRightEdgeMaths
1094 progress: Math.max(rightEdgeDragArea.progress, edgeBarrier.progress)
1095 }
1096 PropertyChanges {
1097 target: appDelegate
1098 x: windowedRightEdgeMaths.animatedX
1099 y: windowedRightEdgeMaths.animatedY
1100 z: windowedRightEdgeMaths.animatedZ
1101 height: stagedRightEdgeMaths.animatedHeight
1102 requestedWidth: decoratedWindow.oldRequestedWidth
1103 requestedHeight: decoratedWindow.oldRequestedHeight
1104 }
1105 PropertyChanges {
1106 target: decoratedWindow
1107 showDecoration: windowedRightEdgeMaths.decorationHeight
1108 angle: windowedRightEdgeMaths.animatedAngle
1109 itemScale: windowedRightEdgeMaths.animatedScale
1110 scaleToPreviewSize: spreadItem.stackHeight
1111 scaleToPreviewProgress: windowedRightEdgeMaths.scaleToPreviewProgress
1112 shadowOpacity: .3
1113 }
1114 PropertyChanges {
1115 target: opacityEffect;
1116 opacityValue: windowedRightEdgeMaths.opacityMask
1117 sourceItem: windowedRightEdgeMaths.opacityMask < 1 ? decoratedWindow : null
1118 }
1119 },
1120 State {
1121 name: "staged"; when: root.state == "staged"
1122 PropertyChanges {
1123 target: appDelegate
1124 x: stageMaths.itemX
1125 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1126 requestedWidth: appContainer.width
1127 requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1128 visuallyMaximized: true
1129 visible: appDelegate.x < root.width
1130 }
1131 PropertyChanges {
1132 target: decoratedWindow
1133 hasDecoration: false
1134 }
1135 PropertyChanges {
1136 target: resizeArea
1137 enabled: false
1138 }
1139 PropertyChanges {
1140 target: stageMaths
1141 animateX: !focusAnimation.running && itemIndex !== spreadItem.highlightedIndex
1142 }
1143 },
1144 State {
1145 name: "stagedWithSideStage"; when: root.state == "stagedWithSideStage"
1146 PropertyChanges {
1147 target: stageMaths
1148 itemIndex: index
1149 }
1150 PropertyChanges {
1151 target: appDelegate
1152 x: stageMaths.itemX
1153 y: appDelegate.fullscreen ? 0 : PanelState.panelHeight
1154 z: stageMaths.itemZ
1155 requestedWidth: stageMaths.itemWidth
1156 requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - PanelState.panelHeight
1157 visuallyMaximized: true
1158 visible: appDelegate.x < root.width
1159 }
1160 PropertyChanges {
1161 target: decoratedWindow
1162 hasDecoration: false
1163 }
1164 PropertyChanges {
1165 target: resizeArea
1166 enabled: false
1167 }
1168 },
1169 State {
1170 name: "maximized"; when: appDelegate.windowState == WindowStateStorage.WindowStateMaximized
1171 PropertyChanges {
1172 target: appDelegate;
1173 requestedX: root.leftMargin;
1174 requestedY: 0;
1175 visuallyMinimized: false;
1176 visuallyMaximized: true
1177 requestedWidth: appContainer.width - root.leftMargin;
1178 requestedHeight: appContainer.height;
1179 }
1180 PropertyChanges { target: touchControls; enabled: true }
1181 },
1182 State {
521 name: "fullscreen"; when: appDelegate.fullscreen && !appDelegate.minimized1183 name: "fullscreen"; when: appDelegate.fullscreen && !appDelegate.minimized
522 PropertyChanges {1184 PropertyChanges {
523 target: appDelegate;1185 target: appDelegate;
524 x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight)1186 requestedX: 0
525 y: rotation == 0 ? -PanelState.panelHeight : (parent.height - height) / 21187 requestedY: 0
526 requestedWidth: appContainer.width;1188 requestedWidth: appContainer.width;
527 requestedHeight: appContainer.height;1189 requestedHeight: appContainer.height;
528 }1190 }
1191 PropertyChanges { target: decoratedWindow; hasDecoration: false }
529 },1192 },
530 State {1193 State {
531 name: "normal";1194 name: "normal";
532 when: appDelegate.windowState == WindowStateStorage.WindowStateNormal1195 when: appDelegate.windowState == WindowStateStorage.WindowStateNormal
533 PropertyChanges {1196 PropertyChanges {
534 target: appDelegate;1197 target: appDelegate
535 visuallyMinimized: false;1198 visuallyMinimized: false
536 visuallyMaximized: false1199 visuallyMaximized: false
537 }1200 }
1201 PropertyChanges { target: touchControls; enabled: true }
1202 PropertyChanges { target: resizeArea; enabled: true }
1203 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
538 },1204 },
539 State {1205 State {
540 name: "restored";1206 name: "restored";
@@ -542,30 +1208,25 @@
542 extend: "normal"1208 extend: "normal"
543 PropertyChanges {1209 PropertyChanges {
544 target: appDelegate;1210 target: appDelegate;
545 requestedX: restoredX;1211 windowedX: restoredX;
546 requestedY: restoredY;1212 windowedY: restoredY;
547 }1213 }
548 },1214 },
549 State {1215 State {
550 name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized1216 name: "semiMaximized"
551 PropertyChanges {1217 PropertyChanges { target: touchControls; enabled: true }
552 target: appDelegate;1218 PropertyChanges { target: resizeArea; enabled: true }
553 requestedX: root.leftMargin;1219 PropertyChanges { target: decoratedWindow; shadowOpacity: .3 }
554 requestedY: 0;
555 requestedWidth: appContainer.width - root.leftMargin;
556 requestedHeight: appContainer.height;
557 visuallyMinimized: false;
558 visuallyMaximized: true
559 }
560 },1220 },
561 State {1221 State {
562 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized1222 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
1223 extend: "semiMaximized"
563 PropertyChanges {1224 PropertyChanges {
564 target: appDelegate1225 target: appDelegate
565 requestedX: root.leftMargin1226 windowedX: root.leftMargin
566 requestedY: PanelState.panelHeight1227 windowedY: PanelState.panelHeight
567 requestedWidth: (appContainer.width - root.leftMargin)/21228 windowedWidth: (appContainer.width - root.leftMargin)/2
568 requestedHeight: appContainer.height - PanelState.panelHeight1229 windowedHeight: appContainer.height - PanelState.panelHeight
569 }1230 }
570 },1231 },
571 State {1232 State {
@@ -573,17 +1234,18 @@
573 extend: "maximizedLeft"1234 extend: "maximizedLeft"
574 PropertyChanges {1235 PropertyChanges {
575 target: appDelegate;1236 target: appDelegate;
576 requestedX: (appContainer.width + root.leftMargin)/21237 windowedX: (appContainer.width + root.leftMargin)/2
577 }1238 }
578 },1239 },
579 State {1240 State {
580 name: "maximizedTopLeft"; when: appDelegate.maximizedTopLeft && !appDelegate.minimized1241 name: "maximizedTopLeft"; when: appDelegate.maximizedTopLeft && !appDelegate.minimized
1242 extend: "semiMaximized"
581 PropertyChanges {1243 PropertyChanges {
582 target: appDelegate1244 target: appDelegate
583 requestedX: root.leftMargin1245 windowedX: root.leftMargin
584 requestedY: PanelState.panelHeight1246 windowedY: PanelState.panelHeight
585 requestedWidth: (appContainer.width - root.leftMargin)/21247 windowedWidth: (appContainer.width - root.leftMargin)/2
586 requestedHeight: (appContainer.height - PanelState.panelHeight)/21248 windowedHeight: (appContainer.height - PanelState.panelHeight)/2
587 }1249 }
588 },1250 },
589 State {1251 State {
@@ -591,17 +1253,18 @@
591 extend: "maximizedTopLeft"1253 extend: "maximizedTopLeft"
592 PropertyChanges {1254 PropertyChanges {
593 target: appDelegate1255 target: appDelegate
594 requestedX: (appContainer.width + root.leftMargin)/21256 windowedX: (appContainer.width + root.leftMargin)/2
595 }1257 }
596 },1258 },
597 State {1259 State {
598 name: "maximizedBottomLeft"; when: appDelegate.maximizedBottomLeft && !appDelegate.minimized1260 name: "maximizedBottomLeft"; when: appDelegate.maximizedBottomLeft && !appDelegate.minimized
1261 extend: "semiMaximized"
599 PropertyChanges {1262 PropertyChanges {
600 target: appDelegate1263 target: appDelegate
601 requestedX: root.leftMargin1264 windowedX: root.leftMargin
602 requestedY: (appContainer.height + PanelState.panelHeight)/21265 windowedY: (appContainer.height + PanelState.panelHeight)/2
603 requestedWidth: (appContainer.width - root.leftMargin)/21266 windowedWidth: (appContainer.width - root.leftMargin)/2
604 requestedHeight: appContainer.height/21267 windowedHeight: appContainer.height/2
605 }1268 }
606 },1269 },
607 State {1270 State {
@@ -609,35 +1272,52 @@
609 extend: "maximizedBottomLeft"1272 extend: "maximizedBottomLeft"
610 PropertyChanges {1273 PropertyChanges {
611 target: appDelegate1274 target: appDelegate
612 requestedX: (appContainer.width + root.leftMargin)/21275 windowedX: (appContainer.width + root.leftMargin)/2
613 }1276 }
614 },1277 },
615 State {1278 State {
616 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized1279 name: "maximizedHorizontally"; when: appDelegate.maximizedHorizontally && !appDelegate.minimized
617 PropertyChanges { target: appDelegate; requestedX: root.leftMargin; requestedY: requestedY; requestedWidth: appContainer.width - root.leftMargin }1280 extend: "semiMaximized"
1281 PropertyChanges { target: appDelegate; requestedX: root.leftMargin; requestedY: windowedY;
1282 requestedWidth: appContainer.width - root.leftMargin; requestedHeight: appDelegate.windowedHeight }
618 },1283 },
619 State {1284 State {
620 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized1285 name: "maximizedVertically"; when: appDelegate.maximizedVertically && !appDelegate.minimized
621 PropertyChanges { target: appDelegate; requestedX: requestedX; requestedY: PanelState.panelHeight; requestedHeight: appContainer.height - PanelState.panelHeight }1286 extend: "semiMaximized"
1287 PropertyChanges { target: appDelegate; requestedX: windowedX; requestedY: PanelState.panelHeight;
1288 requestedWidth: appDelegate.windowedWidth; requestedHeight: appContainer.height - PanelState.panelHeight }
622 },1289 },
623 State {1290 State {
624 name: "minimized"; when: appDelegate.minimized1291 name: "minimized"; when: appDelegate.minimized
625 PropertyChanges {1292 PropertyChanges {
626 target: appDelegate;1293 target: appDelegate
627 requestedX: -appDelegate.width / 2;1294 requestedX: -appDelegate.width / 2
628 scale: units.gu(5) / appDelegate.width;1295 scale: units.gu(5) / appDelegate.width
629 opacity: 0;1296 opacity: 0;
630 visuallyMinimized: true;1297 visuallyMinimized: true
631 visuallyMaximized: false1298 visuallyMaximized: false
632 }1299 }
633 }1300 }
634 ]1301 ]
635 transitions: [1302 transitions: [
636 Transition {1303 Transition {
1304 from: "staged,stagedWithSideStage"; to: "normal"
1305 enabled: appDelegate.animationsEnabled
1306 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
1307 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,opacity,requestedWidth,requestedHeight,scale"; duration: priv.animationDuration }
1308 },
1309 Transition {
1310 from: "normal,maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight";
1311 to: "staged,stagedWithSideStage"
1312 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedX,requestedY,requestedWidth,requestedHeight"; duration: priv.animationDuration}
1313 },
1314 Transition {
1315 from: "maximized,maximizedHorizontally,maximizedVertically,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedBottomLeft,maximizedTopRight,maximizedBottomRight,minimized";
637 to: "normal,restored"1316 to: "normal,restored"
638 enabled: appDelegate.animationsEnabled1317 enabled: appDelegate.animationsEnabled
639 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }1318 PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
640 UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }1319 UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,windowedX,windowedY,requestedWidth,requestedHeight,windowedWidth,windowedHeight,scale";
1320 duration: priv.animationDuration }
641 },1321 },
642 Transition {1322 Transition {
643 to: "minimized"1323 to: "minimized"
@@ -657,11 +1337,60 @@
657 }1337 }
658 },1338 },
659 Transition {1339 Transition {
660 to: "*" //maximized and fullscreen1340 to: "spread"
1341 // DecoratedWindow wants the scaleToPreviewSize set before enabling scaleToPreview
1342 PropertyAction { target: appDelegate; properties: "z,visible" }
1343 PropertyAction { target: decoratedWindow; property: "scaleToPreviewSize" }
1344 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,height"; duration: priv.animationDuration }
1345 UbuntuNumberAnimation { target: decoratedWindow; properties: "width,height,itemScale,angle,scaleToPreviewProgress"; duration: priv.animationDuration }
1346 },
1347 Transition {
1348 from: "normal,staged"; to: "stagedWithSideStage"
1349 UbuntuNumberAnimation { target: appDelegate; properties: "x,y"; duration: priv.animationDuration }
1350 UbuntuNumberAnimation { target: appDelegate; properties: "requestedWidth,requestedHeight"; duration: priv.animationDuration }
1351 },
1352 Transition {
1353 to: "windowedRightEdge"
1354 ScriptAction {
1355 script: {
1356 windowedRightEdgeMaths.startX = appDelegate.requestedX
1357 windowedRightEdgeMaths.startY = appDelegate.requestedY
1358
1359 if (index == 1) {
1360 var thisRect = { x: appDelegate.windowedX, y: appDelegate.windowedY, width: appDelegate.requestedWidth, height: appDelegate.requestedHeight }
1361 var otherDelegate = appRepeater.itemAt(0);
1362 var otherRect = { x: otherDelegate.windowedX, y: otherDelegate.windowedY, width: otherDelegate.requestedWidth, height: otherDelegate.requestedHeight }
1363 var intersectionRect = MathUtils.intersectionRect(thisRect, otherRect)
1364 var mappedInterSectionRect = appDelegate.mapFromItem(root, intersectionRect.x, intersectionRect.y)
1365 opacityEffect.maskX = mappedInterSectionRect.x
1366 opacityEffect.maskY = mappedInterSectionRect.y
1367 opacityEffect.maskWidth = intersectionRect.width
1368 opacityEffect.maskHeight = intersectionRect.height
1369 }
1370 }
1371 }
1372 },
1373 Transition {
1374 from: "stagedRightEdge"; to: "staged"
1375 enabled: rightEdgeDragArea.cancelled // only transition back to state if the gesture was cancelled, in the other cases we play the focusAnimations.
1376 SequentialAnimation {
1377 ParallelAnimation {
1378 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,height,width,scale"; duration: priv.animationDuration }
1379 UbuntuNumberAnimation { target: decoratedWindow; properties: "width,height,itemScale,angle,scaleToPreviewProgress"; duration: priv.animationDuration }
1380 }
1381 // We need to release scaleToPreviewSize at last
1382 PropertyAction { target: decoratedWindow; property: "scaleToPreviewSize" }
1383 PropertyAction { target: appDelegate; property: "visible" }
1384 }
1385 },
1386 Transition {
1387 from: "normal,maximized,maximizedLeft,maximizedRight,maximizedTop,maximizedBottom,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
1388 to: "normal,maximized,maximizedLeft,maximizedRight,maximizedTop,maximizedBottom,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
661 enabled: appDelegate.animationsEnabled1389 enabled: appDelegate.animationsEnabled
662 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
663 SequentialAnimation {1390 SequentialAnimation {
664 UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,opacity,scale,requestedWidth,requestedHeight" }1391 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
1392 UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,windowedX,windowedY,opacity,scale,requestedWidth,requestedHeight,windowedWidth,windowedHeight";
1393 duration: priv.animationDuration }
665 PropertyAction { target: appDelegate; property: "visuallyMaximized" }1394 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
666 ScriptAction { script: { fakeRectangle.stop(); } }1395 ScriptAction { script: { fakeRectangle.stop(); } }
667 }1396 }
@@ -669,14 +1398,6 @@
669 ]1398 ]
6701399
671 Binding {1400 Binding {
672 id: previewBinding
673 target: appDelegate
674 property: "z"
675 value: topLevelSurfaceList.count + 1
676 when: index == spread.highlightedIndex && spread.ready
677 }
678
679 Binding {
680 target: PanelState1401 target: PanelState
681 property: "buttonsAlwaysVisible"1402 property: "buttonsAlwaysVisible"
682 value: appDelegate && appDelegate.maximized && touchControls.overlayShown1403 value: appDelegate && appDelegate.maximized && touchControls.overlayShown
@@ -697,26 +1418,15 @@
697 screenWidth: appContainer.width1418 screenWidth: appContainer.width
698 screenHeight: appContainer.height1419 screenHeight: appContainer.height
699 leftMargin: root.leftMargin1420 leftMargin: root.leftMargin
7001421 enabled: false
701 onPressed: { appDelegate.focus = true; }1422 visible: enabled
7021423
703 Component.onCompleted: {1424 onPressed: {
704 loadWindowState();1425 appDelegate.focus = true;
705 }1426 }
7061427
707 property bool saveStateOnDestruction: true
708 Connections {
709 target: root
710 onStageAboutToBeUnloaded: {
711 resizeArea.saveWindowState();
712 resizeArea.saveStateOnDestruction = false;
713 fullscreenPolicy.active = false;
714 }
715 }
716 Component.onDestruction: {1428 Component.onDestruction: {
717 if (saveStateOnDestruction) {1429 saveWindowState();
718 saveWindowState();
719 }
720 }1430 }
721 }1431 }
7221432
@@ -729,14 +1439,25 @@
729 surface: model.surface1439 surface: model.surface
730 active: appDelegate.focus1440 active: appDelegate.focus
731 focus: true1441 focus: true
1442 interactive: root.interactive
1443 showDecoration: 1
732 maximizeButtonShown: appDelegate.canBeMaximized1444 maximizeButtonShown: appDelegate.canBeMaximized
733 overlayShown: touchControls.overlayShown1445 overlayShown: touchControls.overlayShown
1446 width: implicitWidth
1447 height: implicitHeight
1448 highlightSize: windowInfoItem.iconMargin / 2
734 stageWidth: appContainer.width1449 stageWidth: appContainer.width
735 stageHeight: appContainer.height1450 stageHeight: appContainer.height
7361451
737 requestedWidth: appDelegate.requestedWidth1452 requestedWidth: appDelegate.requestedWidth
738 requestedHeight: appDelegate.requestedHeight1453 requestedHeight: appDelegate.requestedHeight
7391454
1455 property int oldRequestedWidth: -1
1456 property int oldRequestedHeight: -1
1457
1458 onRequestedWidthChanged: oldRequestedWidth = requestedWidth
1459 onRequestedHeightChanged: oldRequestedHeight = requestedHeight
1460
740 onCloseClicked: { appDelegate.close(); }1461 onCloseClicked: { appDelegate.close(); }
741 onMaximizeClicked: appDelegate.anyMaximized ? appDelegate.restoreFromMaximized() : appDelegate.maximize();1462 onMaximizeClicked: appDelegate.anyMaximized ? appDelegate.restoreFromMaximized() : appDelegate.maximize();
742 onMaximizeHorizontallyClicked: appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()1463 onMaximizeHorizontallyClicked: appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()
@@ -744,11 +1465,34 @@
744 onMinimizeClicked: appDelegate.minimize()1465 onMinimizeClicked: appDelegate.minimize()
745 onDecorationPressed: { appDelegate.focus = true; }1466 onDecorationPressed: { appDelegate.focus = true; }
746 onDecorationReleased: fakeRectangle.commit();1467 onDecorationReleased: fakeRectangle.commit();
1468
1469 property real angle: 0
1470 property real itemScale: 1
1471 transform: [
1472 Scale {
1473 origin.x: 0
1474 origin.y: decoratedWindow.implicitHeight / 2
1475 xScale: decoratedWindow.itemScale
1476 yScale: decoratedWindow.itemScale
1477 },
1478 Rotation {
1479 origin { x: 0; y: (decoratedWindow.height / 2) }
1480 axis { x: 0; y: 1; z: 0 }
1481 angle: decoratedWindow.angle
1482 }
1483 ]
1484 }
1485
1486 OpacityMask {
1487 id: opacityEffect
1488 anchors.fill: decoratedWindow
747 }1489 }
7481490
749 WindowControlsOverlay {1491 WindowControlsOverlay {
750 id: touchControls1492 id: touchControls
751 target: appDelegate1493 target: appDelegate
1494 enabled: false
1495 visible: enabled
752 stageWidth: appContainer.width1496 stageWidth: appContainer.width
753 stageHeight: appContainer.height1497 stageHeight: appContainer.height
7541498
@@ -764,9 +1508,89 @@
764 }1508 }
7651509
766 WindowedFullscreenPolicy {1510 WindowedFullscreenPolicy {
767 id: fullscreenPolicy1511 id: windowedFullscreenPolicy
768 active: true1512 active: root.mode == "windowed"
769 surface: model.surface1513 surface: model.surface
1514 }
1515 StagedFullscreenPolicy {
1516 id: stagedFullscreenPolicy
1517 active: root.mode == "staged" || root.mode == "stagedWithSideStage"
1518 surface: model.surface
1519 }
1520
1521 SpreadDelegateInputArea {
1522 id: dragArea
1523 objectName: "dragArea"
1524 anchors.fill: decoratedWindow
1525 enabled: false
1526 closeable: !appDelegate.isDash
1527
1528 onClicked: {
1529 spreadItem.highlightedIndex = index;
1530 if (distance == 0) {
1531 priv.goneToSpread = false;
1532 }
1533 }
1534 onClose: {
1535 priv.closingIndex = index
1536 if (model.surface) { // could be stopped by OOM
1537 model.surface.close()
1538 } else if (model.application) {
1539 root.applicationManager.stopApplication(model.application.appId);
1540 }
1541 }
1542 }
1543
1544 WindowInfoItem {
1545 id: windowInfoItem
1546 objectName: "windowInfoItem"
1547 anchors { left: parent.left; top: decoratedWindow.bottom; topMargin: units.gu(1) }
1548 title: model.application.name
1549 iconSource: model.application.icon
1550 height: spreadItem.appInfoHeight
1551 opacity: 0
1552 z: 1
1553 visible: opacity > 0
1554 maxWidth: {
1555 var nextApp = appRepeater.itemAt(index + 1);
1556 if (nextApp) {
1557 return nextApp.x - appDelegate.x - units.gu(1)
1558 }
1559 return appDelegate.width;
1560 }
1561
1562 onClicked: {
1563 spreadItem.highlightedIndex = index;
1564 priv.goneToSpread = false;
1565 }
1566 }
1567
1568 Image {
1569 id: closeImage
1570 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset }
1571 source: "graphics/window-close.svg"
1572 readonly property var mousePos: hoverMouseArea.mapToItem(appDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1573 visible: !appDelegate.isDash && dragArea.distance == 0
1574 && index == spreadItem.highlightedIndex
1575 && mousePos.y < (decoratedWindow.height / 3)
1576 && mousePos.y > -units.gu(4)
1577 && mousePos.x > -units.gu(4)
1578 && mousePos.x < (decoratedWindow.width * 2 / 3)
1579 height: units.gu(2)
1580 width: height
1581 sourceSize.width: width
1582 sourceSize.height: height
1583
1584 MouseArea {
1585 id: closeMouseArea
1586 objectName: "closeMouseArea"
1587 anchors.fill: closeImage
1588 anchors.margins: -units.gu(2)
1589 onClicked: {
1590 priv.closingIndex = index;
1591 appDelegate.close();
1592 }
1593 }
770 }1594 }
771 }1595 }
772 }1596 }
@@ -786,7 +1610,8 @@
786 // NB: it does its own positioning according to the specified edge1610 // NB: it does its own positioning according to the specified edge
787 edge: Qt.RightEdge1611 edge: Qt.RightEdge
7881612
789 onPassed: { spread.show(); }1613 onPassed: priv.goneToSpread = true;
1614
790 material: Component {1615 material: Component {
791 Item {1616 Item {
792 Rectangle {1617 Rectangle {
@@ -803,23 +1628,248 @@
803 }1628 }
804 }1629 }
8051630
1631 MouseArea {
1632 id: hoverMouseArea
1633 objectName: "hoverMouseArea"
1634 anchors.fill: appContainer
1635 propagateComposedEvents: true
1636 hoverEnabled: true
1637 enabled: false
1638 visible: enabled
1639
1640 property int scrollAreaWidth: width / 3
1641 property bool progressiveScrollingEnabled: false
1642
1643 onMouseXChanged: {
1644 mouse.accepted = false
1645
1646 if (hoverMouseArea.pressed) {
1647 return;
1648 }
1649
1650 // Find the hovered item and mark it active
1651 var mapped = mapToItem(appContainer, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1652 var itemUnder = appContainer.childAt(mapped.x, mapped.y)
1653 if (itemUnder) {
1654 mapped = mapToItem(itemUnder, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
1655 var delegateChild = itemUnder.childAt(mapped.x, mapped.y)
1656 if (delegateChild && (delegateChild.objectName === "dragArea" || delegateChild.objectName === "windowInfoItem")) {
1657 spreadItem.highlightedIndex = appRepeater.indexOf(itemUnder)
1658 }
1659 }
1660
1661 if (floatingFlickable.contentWidth > floatingFlickable.width) {
1662 var margins = floatingFlickable.width * 0.05;
1663
1664 if (!progressiveScrollingEnabled && mouseX < floatingFlickable.width - scrollAreaWidth) {
1665 progressiveScrollingEnabled = true
1666 }
1667
1668 // do we need to scroll?
1669 if (mouseX < scrollAreaWidth + margins) {
1670 var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
1671 var contentX = (1 - progress) * (floatingFlickable.contentWidth - floatingFlickable.width)
1672 floatingFlickable.contentX = Math.max(0, Math.min(floatingFlickable.contentX, contentX))
1673 }
1674 if (mouseX > floatingFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
1675 var progress = Math.min(1, (mouseX - (floatingFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
1676 var contentX = progress * (floatingFlickable.contentWidth - floatingFlickable.width)
1677 floatingFlickable.contentX = Math.min(floatingFlickable.contentWidth - floatingFlickable.width, Math.max(floatingFlickable.contentX, contentX))
1678 }
1679 }
1680 }
1681
1682 onPressed: mouse.accepted = false
1683 }
1684
1685 FloatingFlickable {
1686 id: floatingFlickable
1687 objectName: "spreadFlickable"
1688 anchors.fill: appContainer
1689 enabled: false
1690 contentWidth: spreadItem.spreadTotalWidth
1691
1692 function snap(toIndex) {
1693 var delegate = appRepeater.itemAt(toIndex)
1694 var targetContentX = floatingFlickable.contentWidth / spreadItem.totalItemCount * toIndex;
1695 if (targetContentX - floatingFlickable.contentX > spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) {
1696 var offset = (spreadItem.rightStackXPos - (spreadItem.spreadItemWidth / 2)) - (targetContentX - floatingFlickable.contentX)
1697 snapAnimation.to = floatingFlickable.contentX - offset;
1698 snapAnimation.start();
1699 } else if (targetContentX - floatingFlickable.contentX < spreadItem.leftStackXPos + units.gu(1)) {
1700 var offset = (spreadItem.leftStackXPos + units.gu(1)) - (targetContentX - floatingFlickable.contentX);
1701 snapAnimation.to = floatingFlickable.contentX - offset;
1702 snapAnimation.start();
1703 }
1704 }
1705 UbuntuNumberAnimation {id: snapAnimation; target: floatingFlickable; property: "contentX"}
1706 }
1707
1708 PropertyAnimation {
1709 id: shortRightEdgeSwipeAnimation
1710 property: "x"
1711 to: 0
1712 duration: priv.animationDuration
1713 }
1714
806 SwipeArea {1715 SwipeArea {
1716 id: rightEdgeDragArea
1717 objectName: "rightEdgeDragArea"
807 direction: Direction.Leftwards1718 direction: Direction.Leftwards
808 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }1719 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
809 width: units.gu(1)1720 width: root.dragAreaWidth
810 onDraggingChanged: { if (dragging) { spread.show(); } }1721
1722 property var gesturePoints: []
1723 property bool cancelled: false
1724
1725 property real progress: dragging ? -touchPosition.x / root.width : 0
1726 onProgressChanged: {
1727 if (dragging) {
1728 draggedProgress = progress;
1729 }
1730 }
1731
1732 property real draggedProgress: 0
1733
1734 onTouchPositionChanged: {
1735 gesturePoints.push(touchPosition.x);
1736 if (gesturePoints.length > 10) {
1737 gesturePoints.splice(0, gesturePoints.length - 10)
1738 }
1739 }
1740
1741 onDraggingChanged: {
1742 if (dragging) {
1743 // A potential edge-drag gesture has started. Start recording it
1744 gesturePoints = [];
1745 cancelled = false;
1746 draggedProgress = 0;
1747 } else {
1748 // Ok. The user released. Did he drag far enough to go to full spread?
1749 if (gesturePoints[gesturePoints.length - 1] < -spreadItem.rightEdgeBreakPoint * spreadItem.width ) {
1750
1751 // He dragged far enough, but if the last movement was a flick to the right again, he wants to cancel the spread again.
1752 var oneWayFlickToRight = true;
1753 var smallestX = gesturePoints[0]-1;
1754 for (var i = 0; i < gesturePoints.length; i++) {
1755 if (gesturePoints[i] <= smallestX) {
1756 oneWayFlickToRight = false;
1757 break;
1758 }
1759 smallestX = gesturePoints[i];
1760 }
1761
1762 if (!oneWayFlickToRight) {
1763 // Ok, the user made it, let's go to spread!
1764 priv.goneToSpread = true;
1765 } else {
1766 cancelled = true;
1767 }
1768 } else {
1769 // Ok, the user didn't drag far enough to cross the breakPoint
1770 // Find out if it was a one-way movement to the left, in which case we just switch directly to next app.
1771 var oneWayFlick = true;
1772 var smallestX = rightEdgeDragArea.width;
1773 for (var i = 0; i < gesturePoints.length; i++) {
1774 if (gesturePoints[i] >= smallestX) {
1775 oneWayFlick = false;
1776 break;
1777 }
1778 smallestX = gesturePoints[i];
1779 }
1780
1781 if (appRepeater.count > 1 &&
1782 (oneWayFlick && rightEdgeDragArea.distance > units.gu(2) || rightEdgeDragArea.distance > spreadItem.rightEdgeBreakPoint * spreadItem.width)) {
1783 var nextStage = appRepeater.itemAt(priv.nextInStack).stage
1784 for (var i = 0; i < appRepeater.count; i++) {
1785 if (i != priv.nextInStack && appRepeater.itemAt(i).stage == nextStage) {
1786 appRepeater.itemAt(i).playHidingAnimation()
1787 break;
1788 }
1789 }
1790 appRepeater.itemAt(priv.nextInStack).playFocusAnimation()
1791 if (appRepeater.itemAt(priv.nextInStack).stage == ApplicationInfoInterface.SideStage && !sideStage.shown) {
1792 sideStage.show();
1793 }
1794
1795 } else {
1796 cancelled = true;
1797 }
1798
1799 gesturePoints = [];
1800 }
1801 }
1802 }
811 }1803 }
8121804
813 DesktopSpread {1805 TabletSideStageTouchGesture {
814 id: spread1806 id: triGestureArea
815 objectName: "spread"1807 objectName: "triGestureArea"
816 anchors.fill: appContainer1808 anchors.fill: parent
817 workspace: appContainer1809 enabled: false
818 focus: state == "altTab"1810 property Item appDelegate
819 altTabPressed: root.altTabPressed1811
8201812 dragComponent: dragComponent
821 onPlayFocusAnimation: {1813 dragComponentProperties: { "appDelegate": appDelegate }
822 appRepeater.itemAt(index).playFocusAnimation();1814
1815 onPressed: {
1816 function matchDelegate(obj) { return String(obj.objectName).indexOf("appDelegate") >= 0; }
1817
1818 var delegateAtCenter = Functions.itemAt(appContainer, x, y, matchDelegate);
1819 if (!delegateAtCenter) return;
1820
1821 appDelegate = delegateAtCenter;
1822 }
1823
1824 onClicked: {
1825 if (sideStage.shown) {
1826 sideStage.hide();
1827 } else {
1828 sideStage.show();
1829 priv.updateMainAndSideStageIndexes()
1830 }
1831 }
1832
1833 onDragStarted: {
1834 // If we're dragging to the sidestage.
1835 if (!sideStage.shown) {
1836 sideStage.show();
1837 }
1838 }
1839
1840 Component {
1841 id: dragComponent
1842 SurfaceContainer {
1843 property Item appDelegate
1844
1845 surface: appDelegate ? appDelegate.surface : null
1846
1847 consumesInput: false
1848 interactive: false
1849 focus: false
1850 requestedWidth: appDelegate.requestedWidth
1851 requestedHeight: appDelegate.requestedHeight
1852
1853 width: units.gu(40)
1854 height: units.gu(40)
1855
1856 Drag.hotSpot.x: width/2
1857 Drag.hotSpot.y: height/2
1858 // only accept opposite stage.
1859 Drag.keys: {
1860 if (!surface) return "Disabled";
1861 if (appDelegate.isDash) return "Disabled";
1862
1863 if (appDelegate.stage === ApplicationInfo.MainStage) {
1864 if (appDelegate.application.supportedOrientations
1865 & (Qt.PortraitOrientation|Qt.InvertedPortraitOrientation)) {
1866 return "MainStage";
1867 }
1868 return "Disabled";
1869 }
1870 return "SideStage";
1871 }
1872 }
823 }1873 }
824 }1874 }
825}1875}
8261876
=== added file 'qml/Stage/StageMaths.qml'
--- qml/Stage/StageMaths.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/StageMaths.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,79 @@
1import QtQuick 2.4
2import Unity.Application 0.1
3import Ubuntu.Components 1.3
4
5QtObject {
6 id: root
7
8 // input
9 property int itemIndex: 0
10 property int nextInStack: 0
11 property int sceneWidth: 0
12 property int sideStageWidth: 0
13 property int sideStageX: sceneWidth
14 property bool animateX: false
15 property int leftEdgeDragProgress: 0
16
17 property int stage: ApplicationInfoInterface.MainStage
18 property var thisDelegate: null
19 property var mainStageDelegate: null
20 property var sideStageDelegate: null
21
22 // output
23
24 // We need to shuffle z ordering a bit in order to keep side stage apps above main stage apps.
25 // We don't want to really reorder them in the model because that allows us to keep track
26 // of the last focused order.
27 readonly property int itemZ: {
28 // only shuffle when we've got a main and side stage
29 if (thisDelegate.isDash && thisDelegate != mainStageDelegate && leftEdgeDragProgress > 0) {
30 return -1; // Keep the dash behind all other apps for the left edge gesture
31 }
32
33 if (!sideStageDelegate) return itemIndex;
34
35 // don't shuffle indexes greater than "actives or next"
36 if (itemIndex > 2) return itemIndex;
37
38 if (thisDelegate == mainStageDelegate) {
39 // Active main stage always at 0
40 return 0;
41 }
42
43 if (nextInStack > 0) {
44 var stageOfNextInStack = appRepeater.itemAt(nextInStack).stage;
45
46 if (itemIndex === nextInStack) {
47 // this is the next app in stack.
48
49 if (stage === ApplicationInfoInterface.SideStage) {
50 // if the next app in stack is a sidestage app, it must order on top of other side stage app
51 return Math.min(2, topLevelSurfaceList.count-1);
52 }
53 return 1;
54 }
55 if (stageOfNextInStack === ApplicationInfoInterface.SideStage) {
56 // if the next app in stack is a sidestage app, it must order on top of other side stage app
57 return 1;
58 }
59 return Math.min(2, topLevelSurfaceList.count-1);
60 }
61 return Math.min(index+1, topLevelSurfaceList.count-1);
62 }
63
64
65 property int itemX: {
66 if (mainStageDelegate == thisDelegate) {
67 return thisDelegate.isDash ? 0 : leftEdgeDragProgress;
68 }
69 if (sideStageDelegate == thisDelegate) {
70 return sideStageX;
71 }
72 return thisDelegate.isDash && leftEdgeDragProgress > 0 ? 0 : sceneWidth;
73 }
74 Behavior on itemX { enabled: root.animateX; UbuntuNumberAnimation {} }
75
76 readonly property int itemWidth: stage == ApplicationInfoInterface.MainStage ?
77 sideStageDelegate != null ? sideStageX : sceneWidth :
78 stage == ApplicationInfoInterface.SideStage ? sideStageWidth : sceneWidth
79}
080
=== modified file 'qml/Stage/SurfaceContainer.qml'
--- qml/Stages/SurfaceContainer.qml 2016-05-18 21:58:39 +0000
+++ qml/Stage/SurfaceContainer.qml 2016-10-05 14:03:04 +0000
@@ -23,6 +23,8 @@
23FocusScope {23FocusScope {
24 id: root24 id: root
25 objectName: "surfaceContainer"25 objectName: "surfaceContainer"
26 implicitWidth: surfaceItem.implicitWidth
27 implicitHeight: surfaceItem.implicitHeight
2628
27 // Must be set from outside29 // Must be set from outside
28 property var surface: null30 property var surface: null
@@ -32,7 +34,6 @@
32 property int requestedHeight: -134 property int requestedHeight: -1
33 property bool interactive35 property bool interactive
34 property int surfaceOrientationAngle: 036 property int surfaceOrientationAngle: 0
35 property bool resizeSurface: true
36 property bool isPromptSurface: false37 property bool isPromptSurface: false
37 // FIME - dont export, use interactive property. Need to fix qtmir to handle consumesInputChanged38 // FIME - dont export, use interactive property. Need to fix qtmir to handle consumesInputChanged
38 // to update surface activeFocus. See mock MirSurfaceItem.39 // to update surface activeFocus. See mock MirSurfaceItem.
@@ -58,35 +59,15 @@
58 MirSurfaceItem {59 MirSurfaceItem {
59 id: surfaceItem60 id: surfaceItem
60 objectName: "surfaceItem"61 objectName: "surfaceItem"
62 anchors.fill: parent
6163
62 focus: true64 focus: true
6365
64 fillMode: MirSurfaceItem.PadOrCrop66 fillMode: MirSurfaceItem.PadOrCrop
65 consumesInput: true67 consumesInput: true
6668
67 surfaceWidth: {69 surfaceWidth: root.requestedWidth
68 if (root.resizeSurface) {70 surfaceHeight: root.requestedHeight
69 if (root.requestedWidth >= 0) {
70 return root.requestedWidth;
71 } else {
72 return width;
73 }
74 } else {
75 return -1;
76 }
77 }
78
79 surfaceHeight: {
80 if (root.resizeSurface) {
81 if (root.requestedHeight >= 0) {
82 return root.requestedHeight;
83 } else {
84 return height;
85 }
86 } else {
87 return -1;
88 }
89 }
9071
91 enabled: root.interactive72 enabled: root.interactive
92 antialiasing: !root.interactive73 antialiasing: !root.interactive
@@ -99,34 +80,6 @@
99 enabled: surfaceItem.enabled80 enabled: surfaceItem.enabled
100 }81 }
10182
102 // MirSurface size drives SurfaceContainer size
103 Binding {
104 target: surfaceItem; property: "width"; value: root.surface ? root.surface.size.width : 0
105 when: root.requestedWidth >= 0 && root.surface
106 }
107 Binding {
108 target: surfaceItem; property: "height"; value: root.surface ? root.surface.size.height : 0
109 when: root.requestedHeight >= 0 && root.surface
110 }
111 Binding {
112 target: root; property: "width"; value: surfaceItem.width
113 when: root.requestedWidth >= 0
114 }
115 Binding {
116 target: root; property: "height"; value: surfaceItem.height
117 when: root.requestedHeight >= 0
118 }
119
120 // SurfaceContainer size drives MirSurface size
121 Binding {
122 target: surfaceItem; property: "width"; value: root.width
123 when: root.requestedWidth < 0
124 }
125 Binding {
126 target: surfaceItem; property: "height"; value: root.height
127 when: root.requestedHeight < 0
128 }
129
130 Loader {83 Loader {
131 id: animationsLoader84 id: animationsLoader
132 objectName: "animationsLoader"85 objectName: "animationsLoader"
13386
=== modified file 'qml/Stage/TopLevelSurfaceRepeater.qml'
--- qml/Stages/TopLevelSurfaceRepeater.qml 2016-09-07 09:48:56 +0000
+++ qml/Stage/TopLevelSurfaceRepeater.qml 2016-10-05 14:03:04 +0000
@@ -55,4 +55,13 @@
55 startingUp = false;55 startingUp = false;
56 }56 }
57 }57 }
58
59 function indexOf(delegateItem) {
60 for (var i = 0; i < count; i++) {
61 if (itemAt(i) === delegateItem) {
62 return i;
63 }
64 }
65 return -1;
66 }
58}67}
5968
=== modified file 'qml/Stage/WindowDecoration.qml'
--- qml/Stages/WindowDecoration.qml 2016-09-22 07:42:18 +0000
+++ qml/Stage/WindowDecoration.qml 2016-10-05 14:03:04 +0000
@@ -79,7 +79,7 @@
79 onMaximizeClicked: root.maximizeClicked();79 onMaximizeClicked: root.maximizeClicked();
80 onMaximizeHorizontallyClicked: if (root.target.canBeMaximizedHorizontally) root.maximizeHorizontallyClicked();80 onMaximizeHorizontallyClicked: if (root.target.canBeMaximizedHorizontally) root.maximizeHorizontallyClicked();
81 onMaximizeVerticallyClicked: if (root.target.canBeMaximizedVertically) root.maximizeVerticallyClicked();81 onMaximizeVerticallyClicked: if (root.target.canBeMaximizedVertically) root.maximizeVerticallyClicked();
82 closeButtonShown: root.target.application.appId !== "unity8-dash"82 closeButtonShown: root.target.appId !== "unity8-dash"
83 }83 }
8484
85 Label {85 Label {
8686
=== added file 'qml/Stage/WindowInfoItem.qml'
--- qml/Stage/WindowInfoItem.qml 1970-01-01 00:00:00 +0000
+++ qml/Stage/WindowInfoItem.qml 2016-10-05 14:03:04 +0000
@@ -0,0 +1,53 @@
1import QtQuick 2.4
2import Ubuntu.Components 1.3
3
4Item {
5 id: root
6 implicitWidth: Math.max(iconShape.width, titleLabel.width)
7 implicitHeight: iconShape.height + titleLabel.height + labelMargin + iconMargin
8 property alias title: titleLabel.text
9 property alias iconSource: icon.source
10
11 property real iconHeight: (height - titleLabel.height) * 0.65
12 property real iconMargin: (height - titleLabel.height) * 0.25
13 property real labelMargin: (height - titleLabel.height) * 0.1
14 property int maxWidth: units.gu(10)
15
16 signal clicked()
17
18 ProportionalShape {
19 id: iconShape
20 anchors {
21 top: parent.top
22 topMargin: iconMargin
23 left: parent.left
24 }
25 height: iconHeight
26 borderSource: "undefined"
27 aspect: UbuntuShape.Flat
28 source: Image {
29 id: icon
30 sourceSize.width: iconShape.width
31 sourceSize.height: iconShape.height
32 cache: false // see lpbug#1543290 why no cache
33 }
34 }
35
36 MouseArea {
37 anchors.fill: iconShape
38 onClicked: root.clicked()
39 }
40
41 Label {
42 id: titleLabel
43 anchors {
44 left: iconShape.left
45 top: iconShape.bottom
46 topMargin: labelMargin
47 }
48 width: root.maxWidth
49 fontSize: 'small'
50 color: 'white'
51 elide: Label.ElideRight
52 }
53}
054
=== modified file 'qml/Stage/WindowResizeArea.qml'
--- qml/Stages/WindowResizeArea.qml 2016-08-31 13:00:26 +0000
+++ qml/Stage/WindowResizeArea.qml 2016-10-05 14:03:04 +0000
@@ -75,14 +75,15 @@
7575
76 function loadWindowState() {76 function loadWindowState() {
77 var windowGeometry = windowStateStorage.getGeometry(root.windowId,77 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
78 Qt.rect(target.requestedX, target.requestedY, defaultWidth, defaultHeight));78 Qt.rect(target.windowedX, target.windowedY, defaultWidth, defaultHeight));
7979
80 target.requestedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });80
81 target.requestedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),81 target.windowedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
82 target.windowedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
82 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });83 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });
83 target.requestedX = Qt.binding(function() { return Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.requestedWidth),84 target.windowedX = Qt.binding(function() { return Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.windowedWidth),
84 (target.fullscreen ? 0 : root.leftMargin)); });85 (target.fullscreen ? 0 : root.leftMargin)); });
85 target.requestedY = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight); });86 target.windowedY = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, root.screenHeight - target.windowedHeight), PanelState.panelHeight); });
8687
87 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)88 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
88 target.restore(false /* animated */, windowState);89 target.restore(false /* animated */, windowState);
@@ -111,28 +112,28 @@
111112
112 readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth113 readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth
113 onMinimumWidthChanged: {114 onMinimumWidthChanged: {
114 if (target.requestedWidth < minimumWidth) {115 if (target.windowedWidth < minimumWidth) {
115 target.requestedWidth = minimumWidth;116 target.windowedWidth = minimumWidth;
116 }117 }
117 }118 }
118 readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight119 readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight
119 onMinimumHeightChanged: {120 onMinimumHeightChanged: {
120 if (target.requestedHeight < minimumHeight) {121 if (target.windowedHeight < minimumHeight) {
121 target.requestedHeight = minimumHeight;122 target.windowedHeight = minimumHeight;
122 }123 }
123 }124 }
124 readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0125 readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0
125 ? root.target.maximumWidth : maxSafeInt126 ? root.target.maximumWidth : maxSafeInt
126 onMaximumWidthChanged: {127 onMaximumWidthChanged: {
127 if (target.requestedWidth > maximumWidth) {128 if (target.windowedWidth > maximumWidth) {
128 target.requestedWidth = maximumWidth;129 target.windowedWidth = maximumWidth;
129 }130 }
130 }131 }
131 readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0132 readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0
132 ? root.target.maximumHeight : maxSafeInt133 ? root.target.maximumHeight : maxSafeInt
133 onMaximumHeightChanged: {134 onMaximumHeightChanged: {
134 if (target.requestedHeight > maximumHeight) {135 if (target.windowedHeight > maximumHeight) {
135 target.requestedHeight = maximumHeight;136 target.windowedHeight = maximumHeight;
136 }137 }
137 }138 }
138 readonly property int widthIncrement: {139 readonly property int widthIncrement: {
@@ -247,8 +248,8 @@
247 var pos = mapToItem(root.target.parent, mouseX, mouseY);248 var pos = mapToItem(root.target.parent, mouseX, mouseY);
248 d.startMousePosX = pos.x;249 d.startMousePosX = pos.x;
249 d.startMousePosY = pos.y;250 d.startMousePosY = pos.y;
250 d.startX = target.requestedX;251 d.startX = target.windowedX;
251 d.startY = target.requestedY;252 d.startY = target.windowedY;
252 d.startWidth = target.width;253 d.startWidth = target.width;
253 d.startHeight = target.height;254 d.startHeight = target.height;
254 d.currentWidth = target.width;255 d.currentWidth = target.width;
@@ -285,53 +286,53 @@
285286
286 if (d.leftBorder) {287 if (d.leftBorder) {
287 var newTargetX = d.startX + deltaX;288 var newTargetX = d.startX + deltaX;
288 var rightBorderX = target.requestedX + target.width;289 var rightBorderX = target.windowedX + target.width;
289 if (rightBorderX > newTargetX + d.minimumWidth) {290 if (rightBorderX > newTargetX + d.minimumWidth) {
290 if (rightBorderX < newTargetX + d.maximumWidth) {291 if (rightBorderX < newTargetX + d.maximumWidth) {
291 target.requestedWidth = rightBorderX - newTargetX;292 target.windowedWidth = rightBorderX - newTargetX;
292 } else {293 } else {
293 target.requestedWidth = d.maximumWidth;294 target.windowedWidth = d.maximumWidth;
294 }295 }
295 } else {296 } else {
296 target.requestedWidth = d.minimumWidth;297 target.windowedWidth = d.minimumWidth;
297 }298 }
298299
299 } else if (d.rightBorder) {300 } else if (d.rightBorder) {
300 var newWidth = d.startWidth + deltaX;301 var newWidth = d.startWidth + deltaX;
301 if (newWidth > d.minimumWidth) {302 if (newWidth > d.minimumWidth) {
302 if (newWidth < d.maximumWidth) {303 if (newWidth < d.maximumWidth) {
303 target.requestedWidth = newWidth;304 target.windowedWidth = newWidth;
304 } else {305 } else {
305 target.requestedWidth = d.maximumWidth;306 target.windowedWidth = d.maximumWidth;
306 }307 }
307 } else {308 } else {
308 target.requestedWidth = d.minimumWidth;309 target.windowedWidth = d.minimumWidth;
309 }310 }
310 }311 }
311312
312 if (d.topBorder) {313 if (d.topBorder) {
313 var newTargetY = Math.max(d.startY + deltaY, PanelState.panelHeight); // disallow resizing up past Panel314 var newTargetY = Math.max(d.startY + deltaY, PanelState.panelHeight); // disallow resizing up past Panel
314 var bottomBorderY = target.requestedY + target.height;315 var bottomBorderY = target.windowedY + target.height;
315 if (bottomBorderY > newTargetY + d.minimumHeight) {316 if (bottomBorderY > newTargetY + d.minimumHeight) {
316 if (bottomBorderY < newTargetY + d.maximumHeight) {317 if (bottomBorderY < newTargetY + d.maximumHeight) {
317 target.requestedHeight = bottomBorderY - newTargetY;318 target.windowedHeight = bottomBorderY - newTargetY;
318 } else {319 } else {
319 target.requestedHeight = d.maximumHeight;320 target.windowedHeight = d.maximumHeight;
320 }321 }
321 } else {322 } else {
322 target.requestedHeight = d.minimumHeight;323 target.windowedHeight = d.minimumHeight;
323 }324 }
324325
325 } else if (d.bottomBorder) {326 } else if (d.bottomBorder) {
326 var newHeight = d.startHeight + deltaY;327 var newHeight = d.startHeight + deltaY;
327 if (newHeight > d.minimumHeight) {328 if (newHeight > d.minimumHeight) {
328 if (newHeight < d.maximumHeight) {329 if (newHeight < d.maximumHeight) {
329 target.requestedHeight = newHeight;330 target.windowedHeight = newHeight;
330 } else {331 } else {
331 target.requestedHeight = d.maximumHeight;332 target.windowedHeight = d.maximumHeight;
332 }333 }
333 } else {334 } else {
334 target.requestedHeight = d.minimumHeight;335 target.windowedHeight = d.minimumHeight;
335 }336 }
336 }337 }
337 }338 }
@@ -340,13 +341,13 @@
340 target: root.target341 target: root.target
341 onWidthChanged: {342 onWidthChanged: {
342 if (d.moveLeftBorder) {343 if (d.moveLeftBorder) {
343 target.requestedX += d.currentWidth - target.width;344 target.windowedX += d.currentWidth - target.width;
344 }345 }
345 d.currentWidth = target.width;346 d.currentWidth = target.width;
346 }347 }
347 onHeightChanged: {348 onHeightChanged: {
348 if (d.moveTopBorder) {349 if (d.moveTopBorder) {
349 target.requestedY += d.currentHeight - target.height;350 target.windowedY += d.currentHeight - target.height;
350 }351 }
351 d.currentHeight = target.height;352 d.currentHeight = target.height;
352 }353 }
353354
=== removed file 'qml/Stages/AbstractStage.qml'
--- qml/Stages/AbstractStage.qml 2016-09-07 08:36:59 +0000
+++ qml/Stages/AbstractStage.qml 1970-01-01 00:00:00 +0000
@@ -1,93 +0,0 @@
1/*
2 * Copyright (C) 2015-2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import GlobalShortcut 1.0
20import GSettings 1.0
21
22FocusScope {
23 id: root
24
25 // Controls to be set from outside
26 property QtObject applicationManager
27 property QtObject topLevelSurfaceList
28 property bool altTabPressed
29 property url background
30 property bool beingResized
31 property int dragAreaWidth
32 property real dragProgress // How far left the stage has been dragged, used externally by tutorial code
33 property bool interactive
34 property real inverseProgress // This is the progress for left edge drags, in pixels.
35 property bool keepDashRunning: true
36 property real maximizedAppTopMargin
37 property real nativeHeight
38 property real nativeWidth
39 property QtObject orientations
40 property int shellOrientation
41 property int shellOrientationAngle
42 property bool spreadEnabled: true // If false, animations and right edge will be disabled
43 property bool suspended
44 // A Stage should paint a wallpaper etc over its full size but not use the margins for window placement
45 property int leftMargin: 0
46 property alias paintBackground: background.visible
47 property bool oskEnabled: false
48
49 // To be read from outside
50 property var mainApp: null
51 property int mainAppWindowOrientationAngle: 0
52 property bool orientationChangesEnabled
53 property int supportedOrientations: Qt.PortraitOrientation
54 | Qt.LandscapeOrientation
55 | Qt.InvertedPortraitOrientation
56 | Qt.InvertedLandscapeOrientation
57
58 property Item itemConfiningMouseCursor: null
59
60
61 signal stageAboutToBeUnloaded
62 signal itemSnapshotRequested(Item item)
63
64 // Shared code for use in stage implementations
65 GSettings {
66 id: lifecycleExceptions
67 schema.id: "com.canonical.qtmir"
68 }
69
70 function isExemptFromLifecycle(appId) {
71 var shortAppId = appId.split('_')[0];
72 for (var i = 0; i < lifecycleExceptions.lifecycleExemptAppids.length; i++) {
73 if (shortAppId === lifecycleExceptions.lifecycleExemptAppids[i]) {
74 return true;
75 }
76 }
77 return false;
78 }
79
80 Rectangle {
81 id: background
82 color: "#060606"
83 anchors.fill: parent
84 }
85
86 // shared Alt+F4 functionality
87 function closeFocusedDelegate() {} // to be implemented by stages
88
89 GlobalShortcut {
90 shortcut: Qt.AltModifier|Qt.Key_F4
91 onTriggered: closeFocusedDelegate()
92 }
93}
940
=== removed file 'qml/Stages/DesktopSpread.qml'
--- qml/Stages/DesktopSpread.qml 2016-06-15 14:08:18 +0000
+++ qml/Stages/DesktopSpread.qml 1970-01-01 00:00:00 +0000
@@ -1,576 +0,0 @@
1/*
2 * Copyright (C) 2015-2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.3
20import Ubuntu.Gestures 0.1
21import Unity.Application 0.1
22import "../Components"
23import Utils 0.1
24
25FocusScope {
26 id: root
27
28 property bool altTabPressed: false
29 property Item workspace: null
30
31 readonly property alias ready: blurLayer.ready
32 readonly property alias highlightedIndex: spreadRepeater.highlightedIndex
33
34 signal playFocusAnimation(int index)
35
36 function show() {
37 spreadContainer.animateIn = true;
38 root.state = "altTab";
39 }
40
41 onFocusChanged: {
42 // When the spread comes active, we want to keep focus to the input handler below
43 // Make sure nothing inside the ApplicationWindow grabs our focus!
44 if (focus) {
45 forceActiveFocus();
46 }
47 }
48
49 Keys.onPressed: {
50 switch (event.key) {
51 case Qt.Key_Left:
52 case Qt.Key_Backtab:
53 selectPrevious(event.isAutoRepeat)
54 event.accepted = true;
55 break;
56 case Qt.Key_Right:
57 case Qt.Key_Tab:
58 selectNext(event.isAutoRepeat)
59 event.accepted = true;
60 break;
61 case Qt.Key_Escape:
62 spreadRepeater.highlightedIndex = -1
63 // Falling through intentionally
64 case Qt.Key_Enter:
65 case Qt.Key_Return:
66 case Qt.Key_Space:
67 root.state = ""
68 event.accepted = true;
69 }
70 }
71
72 function selectNext(isAutoRepeat) {
73 if (isAutoRepeat && spreadRepeater.highlightedIndex >= topLevelSurfaceList.count -1) {
74 return; // AutoRepeat is not allowed to wrap around
75 }
76
77 spreadRepeater.highlightedIndex = (spreadRepeater.highlightedIndex + 1) % topLevelSurfaceList.count;
78 var newContentX = ((spreadFlickable.contentWidth) / (topLevelSurfaceList.count + 1)) * Math.max(0, Math.min(topLevelSurfaceList.count - 5, spreadRepeater.highlightedIndex - 3));
79 if (spreadFlickable.contentX < newContentX || spreadRepeater.highlightedIndex == 0) {
80 spreadFlickable.snapTo(newContentX)
81 }
82 }
83
84 function selectPrevious(isAutoRepeat) {
85 if (isAutoRepeat && spreadRepeater.highlightedIndex == 0) {
86 return; // AutoRepeat is not allowed to wrap around
87 }
88
89 var newIndex = spreadRepeater.highlightedIndex - 1 >= 0 ? spreadRepeater.highlightedIndex - 1 : topLevelSurfaceList.count - 1;
90 spreadRepeater.highlightedIndex = newIndex;
91 var newContentX = ((spreadFlickable.contentWidth) / (topLevelSurfaceList.count + 1)) * Math.max(0, Math.min(topLevelSurfaceList.count - 5, spreadRepeater.highlightedIndex - 1));
92 if (spreadFlickable.contentX > newContentX || newIndex == topLevelSurfaceList.count -1) {
93 spreadFlickable.snapTo(newContentX)
94 }
95 }
96
97 function focusSelected() {
98 if (spreadRepeater.highlightedIndex != -1) {
99 if (spreadContainer.visible) {
100 root.playFocusAnimation(spreadRepeater.highlightedIndex)
101 }
102 var surface = topLevelSurfaceList.surfaceAt(spreadRepeater.highlightedIndex);
103 surface.requestFocus();
104 }
105 }
106
107 function cancel() {
108 spreadRepeater.highlightedIndex = -1;
109 state = ""
110 }
111
112 BlurLayer {
113 id: blurLayer
114 anchors.fill: parent
115 source: root.workspace
116 visible: false
117 }
118
119 Rectangle {
120 id: spreadBackground
121 anchors.fill: parent
122 color: "#B2000000"
123 visible: false
124 opacity: visible ? 1 : 0
125 Behavior on opacity {
126 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
127 }
128 }
129
130 MouseArea {
131 id: eventEater
132 anchors.fill: parent
133 visible: spreadBackground.visible
134 enabled: visible
135 acceptedButtons: Qt.AllButtons
136 onWheel: wheel.accepted = true;
137 }
138
139 Item {
140 id: spreadContainer
141 objectName: "spreadContainer"
142 anchors.fill: parent
143 visible: false
144
145 property bool animateIn: false
146
147 Repeater {
148 id: spreadRepeater
149 objectName: "spreadRepeater"
150 model: topLevelSurfaceList
151
152 property int highlightedIndex: -1
153 property int closingIndex: -1
154
155 function indexOf(delegateItem) {
156 for (var i = 0; i < spreadRepeater.count; i++) {
157 if (spreadRepeater.itemAt(i) === delegateItem) {
158 return i;
159 }
160 }
161 return -1;
162 }
163
164 delegate: Item {
165 id: spreadDelegate
166 objectName: "spreadDelegate"
167 width: units.gu(20)
168 height: units.gu(20)
169
170 property real angle: 0
171 property real itemScale: 1
172 property int itemScaleOriginX: 0
173 property int itemScaleOriginY: 0
174
175 readonly property string windowTitle: clippedSpreadDelegate.window.title
176
177 Behavior on x {
178 id: closeBehavior
179 enabled: spreadRepeater.closingIndex >= 0
180 UbuntuNumberAnimation {
181 onRunningChanged: if (!running) spreadRepeater.closingIndex = -1
182 }
183 }
184
185 DesktopSpreadDelegate {
186 id: clippedSpreadDelegate
187 objectName: "clippedSpreadDelegate"
188 anchors.left: parent.left
189 anchors.top: parent.top
190 application: model.application
191 surface: model.surface
192 width: spreadMaths.spreadHeight
193 height: spreadMaths.spreadHeight
194
195 transform: [
196 Scale {
197 origin.x: itemScaleOriginX
198 origin.y: itemScaleOriginY
199 xScale: itemScale
200 yScale: itemScale
201 },
202 Rotation {
203 origin { x: 0; y: (clippedSpreadDelegate.height - (clippedSpreadDelegate.height * itemScale / 2)) }
204 axis { x: 0; y: 1; z: 0 }
205 angle: spreadDelegate.angle
206 }
207 ]
208
209 MouseArea {
210 id: spreadSelectArea
211 anchors.fill: parent
212 anchors.margins: -units.gu(2)
213 enabled: false
214 onClicked: {
215 spreadRepeater.highlightedIndex = index;
216 root.state = "";
217 }
218 }
219 }
220
221 SpreadMaths {
222 id: spreadMaths
223 flickable: spreadFlickable
224 itemIndex: index
225 totalItems: Math.max(6, topLevelSurfaceList.count)
226 sceneHeight: root.height
227 itemHeight: spreadDelegate.height
228 }
229
230 states: [
231 State {
232 name: "altTab"; when: root.state == "altTab" && spreadContainer.visible
233 PropertyChanges {
234 target: spreadDelegate
235 x: spreadMaths.animatedX
236 y: spreadMaths.animatedY + (spreadDelegate.height - clippedSpreadDelegate.height) - units.gu(2)
237 width: spreadMaths.spreadHeight
238 height: spreadMaths.sceneHeight
239 angle: spreadMaths.animatedAngle
240 itemScale: spreadMaths.scale
241 itemScaleOriginY: clippedSpreadDelegate.height / 2;
242 z: index
243 visible: spreadMaths.itemVisible
244 }
245 PropertyChanges {
246 target: clippedSpreadDelegate
247 highlightShown: index == spreadRepeater.highlightedIndex
248 state: "transformed"
249 shadowOpacity: spreadMaths.shadowOpacity
250 anchors.topMargin: units.gu(2)
251 }
252 PropertyChanges {
253 target: tileInfo
254 visible: true
255 opacity: spreadMaths.tileInfoOpacity
256 }
257 PropertyChanges {
258 target: spreadSelectArea
259 enabled: true
260 }
261 }
262 ]
263 transitions: [
264 Transition {
265 from: ""
266 to: "altTab"
267 SequentialAnimation {
268 ParallelAnimation {
269 PropertyAction { target: spreadDelegate; properties: "y,height,width,angle,z,itemScale,itemScaleOriginY,visible" }
270 PropertyAction { target: clippedSpreadDelegate; properties: "anchors.topMargin" }
271 PropertyAnimation {
272 target: spreadDelegate; properties: "x"
273 from: root.width
274 duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration :0
275 easing: UbuntuAnimation.StandardEasing
276 }
277 UbuntuNumberAnimation { target: clippedSpreadDelegate; property: "shadowOpacity"; from: 0; to: spreadMaths.shadowOpacity; duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration : 0 }
278 UbuntuNumberAnimation { target: tileInfo; property: "opacity"; from: 0; to: spreadMaths.tileInfoOpacity; duration: spreadContainer.animateIn ? UbuntuAnimation.FastDuration : 0 }
279 }
280 PropertyAction { target: spreadSelectArea; property: "enabled" }
281 }
282 }
283 ]
284
285 MouseArea {
286 id: tileInfo
287 objectName: "tileInfo"
288 anchors {
289 left: parent.left
290 top: clippedSpreadDelegate.bottom
291 topMargin: ((spreadMaths.sceneHeight - spreadDelegate.y) - clippedSpreadDelegate.height) * 0.2
292 }
293 property int nextItemX: spreadRepeater.count > index + 1 ? spreadRepeater.itemAt(index + 1).x : spreadDelegate.x + units.gu(30)
294 width: Math.min(units.gu(30), nextItemX - spreadDelegate.x)
295 height: titleInfoColumn.height
296 visible: false
297 hoverEnabled: true
298
299 onContainsMouseChanged: {
300 if (containsMouse) {
301 spreadRepeater.highlightedIndex = index
302 }
303 }
304
305 onClicked: {
306 root.state = ""
307 }
308
309 ColumnLayout {
310 id: titleInfoColumn
311 anchors { left: parent.left; top: parent.top; right: parent.right }
312 spacing: units.gu(1)
313
314 UbuntuShapeForItem {
315 Layout.preferredHeight: Math.min(units.gu(6), root.height * .05)
316 Layout.preferredWidth: height * 8 / 7.6
317 image: Image {
318 anchors.fill: parent
319 source: model.application.icon
320 Rectangle {
321 anchors.fill: parent
322 color: "black"
323 opacity: clippedSpreadDelegate.highlightShown ? 0 : .1
324 Behavior on opacity {
325 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
326 }
327 }
328 }
329 }
330 Label {
331 Layout.fillWidth: true
332 Layout.preferredHeight: units.gu(6)
333 text: model.application ? model.application.name : spreadDelegate.windowTitle
334 wrapMode: Text.WordWrap
335 elide: Text.ElideRight
336 maximumLineCount: 2
337 }
338 }
339 }
340
341 Image {
342 id: closeImage
343 anchors { left: parent.left; top: parent.top; leftMargin: -height / 2; topMargin: -height / 2 + spreadMaths.closeIconOffset + units.gu(2) }
344 source: "graphics/window-close.svg"
345 readonly property var mousePos: hoverMouseArea.mapToItem(spreadDelegate, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
346 visible: index == spreadRepeater.highlightedIndex
347 && mousePos.y < (clippedSpreadDelegate.height / 3)
348 && mousePos.y > -units.gu(4)
349 && mousePos.x > -units.gu(4)
350 && mousePos.x < (clippedSpreadDelegate.width * 2 / 3)
351 height: units.gu(1.5)
352 width: height
353 sourceSize.width: width
354 sourceSize.height: height
355
356 MouseArea {
357 id: closeMouseArea
358 objectName: "closeMouseArea"
359 anchors.fill: closeImage
360 anchors.margins: -units.gu(2)
361 onClicked: {
362 spreadRepeater.closingIndex = index;
363 model.surface.close();
364 }
365 }
366 }
367 }
368 }
369 }
370
371
372 MouseArea {
373 id: hoverMouseArea
374 objectName: "hoverMouseArea"
375 anchors.fill: spreadContainer
376 propagateComposedEvents: true
377 hoverEnabled: true
378 enabled: false
379 visible: enabled
380
381 property int scrollAreaWidth: root.width / 3
382 property bool progressiveScrollingEnabled: false
383
384 onMouseXChanged: {
385 mouse.accepted = false
386
387 if (hoverMouseArea.pressed) {
388 return;
389 }
390
391 // Find the hovered item and mark it active
392 var mapped = mapToItem(spreadContainer, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
393 var itemUnder = spreadContainer.childAt(mapped.x, mapped.y)
394 if (itemUnder) {
395 mapped = mapToItem(itemUnder, hoverMouseArea.mouseX, hoverMouseArea.mouseY)
396 var delegateChild = itemUnder.childAt(mapped.x, mapped.y)
397 if (delegateChild && (delegateChild.objectName === "clippedSpreadDelegate" || delegateChild.objectName === "tileInfo")) {
398 spreadRepeater.highlightedIndex = spreadRepeater.indexOf(itemUnder)
399 }
400 }
401
402 if (spreadFlickable.contentWidth > spreadFlickable.minContentWidth) {
403 var margins = spreadFlickable.width * 0.05;
404
405 if (!progressiveScrollingEnabled && mouseX < spreadFlickable.width - scrollAreaWidth) {
406 progressiveScrollingEnabled = true
407 }
408
409 // do we need to scroll?
410 if (mouseX < scrollAreaWidth + margins) {
411 var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
412 var contentX = (1 - progress) * (spreadFlickable.contentWidth - spreadFlickable.width)
413 spreadFlickable.contentX = Math.max(0, Math.min(spreadFlickable.contentX, contentX))
414 }
415 if (mouseX > spreadFlickable.width - scrollAreaWidth && progressiveScrollingEnabled) {
416 var progress = Math.min(1, (mouseX - (spreadFlickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
417 var contentX = progress * (spreadFlickable.contentWidth - spreadFlickable.width)
418 spreadFlickable.contentX = Math.min(spreadFlickable.contentWidth - spreadFlickable.width, Math.max(spreadFlickable.contentX, contentX))
419 }
420 }
421 }
422 onPressed: mouse.accepted = false
423 }
424
425 FloatingFlickable {
426 id: spreadFlickable
427 objectName: "spreadFlickable"
428 anchors.fill: parent
429 property int minContentWidth: 6 * Math.min(height / 4, width / 5)
430 contentWidth: Math.max(6, topLevelSurfaceList.count) * Math.min(height / 4, width / 5)
431 enabled: false
432
433 function snapTo(contentX) {
434 snapAnimation.stop();
435 snapAnimation.to = contentX
436 snapAnimation.start();
437 }
438
439 UbuntuNumberAnimation {
440 id: snapAnimation
441 target: spreadFlickable
442 property: "contentX"
443 }
444 }
445
446 Item {
447 id: workspaceSelector
448 anchors {
449 left: parent.left
450 top: parent.top
451 right: parent.right
452 topMargin: units.gu(3.5)
453 }
454 height: root.height * 0.25
455 visible: false
456
457 RowLayout {
458 anchors.fill: parent
459 spacing: units.gu(1)
460 Item { Layout.fillWidth: true }
461 Repeater {
462 model: 1 // TODO: will be a workspacemodel in the future
463 Item {
464 Layout.fillHeight: true
465 Layout.preferredWidth: ((height - units.gu(6)) * root.width / root.height)
466 Image {
467 source: root.background
468 anchors {
469 left: parent.left
470 right: parent.right
471 verticalCenter: parent.verticalCenter
472 }
473 height: parent.height * 0.75
474
475 ShaderEffect {
476 anchors.fill: parent
477
478 property var source: ShaderEffectSource {
479 id: shaderEffectSource
480 sourceItem: root.workspace
481 }
482
483 fragmentShader: "
484 varying highp vec2 qt_TexCoord0;
485 uniform sampler2D source;
486 void main(void)
487 {
488 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
489 gl_FragColor = sourceColor;
490 }"
491 }
492 }
493
494 // TODO: This is the bar for the currently selected workspace
495 // Enable this once the workspace stuff is implemented
496 // Rectangle {
497 // anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
498 // height: units.dp(2)
499 // color: theme.palette.normal.focus
500 // visible: index == 0 // TODO: should be active workspace index
501 // }
502 }
503
504 }
505 // TODO: This is the "new workspace" button. Enable this once workspaces are implemented
506 // Item {
507 // Layout.fillHeight: true
508 // Layout.preferredWidth: ((height - units.gu(6)) * root.width / root.height)
509 // Rectangle {
510 // anchors {
511 // left: parent.left
512 // right: parent.right
513 // verticalCenter: parent.verticalCenter
514 // }
515 // height: parent.height * 0.75
516 // color: "#22ffffff"
517
518 // Label {
519 // anchors.centerIn: parent
520 // font.pixelSize: parent.height / 2
521 // text: "+"
522 // }
523 // }
524 // }
525 Item { Layout.fillWidth: true }
526 }
527 }
528
529 Label {
530 id: currentSelectedLabel
531 anchors { bottom: parent.bottom; bottomMargin: root.height * 0.625; horizontalCenter: parent.horizontalCenter }
532 text: spreadRepeater.highlightedIndex >= 0 ? spreadRepeater.itemAt(spreadRepeater.highlightedIndex).windowTitle: ""
533 visible: false
534 fontSize: "large"
535 }
536
537 states: [
538 State {
539 name: "altTab"; when: root.altTabPressed
540 PropertyChanges { target: blurLayer; saturation: 0.8; blurRadius: 60; visible: true }
541 PropertyChanges { target: workspaceSelector; visible: true }
542 PropertyChanges { target: spreadContainer; visible: true }
543 PropertyChanges { target: spreadFlickable; enabled: spreadFlickable.contentWidth > spreadFlickable.minContentWidth }
544 PropertyChanges { target: currentSelectedLabel; visible: true }
545 PropertyChanges { target: spreadBackground; visible: true }
546 PropertyChanges { target: hoverMouseArea; enabled: true }
547 }
548 ]
549 transitions: [
550 Transition {
551 from: "*"
552 to: "altTab"
553 SequentialAnimation {
554 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: Math.min(topLevelSurfaceList.count - 1, 1) }
555 PauseAnimation { duration: spreadContainer.animateIn ? 0 : 140 }
556 PropertyAction { target: workspaceSelector; property: "visible" }
557 PropertyAction { target: spreadContainer; property: "visible" }
558 ParallelAnimation {
559 UbuntuNumberAnimation { target: blurLayer; properties: "saturation,blurRadius"; duration: UbuntuAnimation.SnapDuration }
560 PropertyAction { target: spreadFlickable; property: "visible" }
561 PropertyAction { targets: [currentSelectedLabel,spreadBackground]; property: "visible" }
562 PropertyAction { target: spreadFlickable; property: "contentX"; value: 0 }
563 }
564 PropertyAction { target: hoverMouseArea; properties: "enabled,progressiveScrollingEnabled"; value: false }
565 }
566 },
567 Transition {
568 from: "*"
569 to: "*"
570 PropertyAnimation { property: "opacity" }
571 ScriptAction { script: { root.focusSelected() } }
572 PropertyAction { target: spreadRepeater; property: "highlightedIndex"; value: -1 }
573 PropertyAction { target: spreadContainer; property: "animateIn"; value: false }
574 }
575 ]
576}
5770
=== removed file 'qml/Stages/DesktopSpreadDelegate.qml'
--- qml/Stages/DesktopSpreadDelegate.qml 2016-05-17 20:46:51 +0000
+++ qml/Stages/DesktopSpreadDelegate.qml 1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
1/*
2 * Copyright (C) 2014-2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
17 */
18
19import QtQuick 2.4
20import Ubuntu.Components 1.3
21import Unity.Application 0.1
22
23Item {
24 id: root
25
26 property alias window: applicationWindow
27 property alias application: applicationWindow.application
28 property alias surface: applicationWindow.surface
29
30 property bool highlightShown: false
31 property real shadowOpacity: 1
32
33 property int windowWidth: surface ? surface.size.width : 0
34 property int windowHeight: surface ? surface.size.height : 0
35
36 state: "normal"
37 states: [
38 State {
39 name: "normal"
40 PropertyChanges {
41 target: root
42 width: windowWidth
43 height: windowHeight
44 }
45 },
46 State {
47 name: "transformed"
48 PropertyChanges {
49 target: applicationWindow
50 itemScale: Math.max(root.width / root.windowWidth, root.height / root.windowHeight)
51 interactive: false
52 }
53 PropertyChanges {
54 target: clipper
55 clip: true
56 }
57 }
58 ]
59
60 scale: highlightShown ? 1.025 : 1
61 Behavior on scale {
62 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
63 }
64
65 BorderImage {
66 anchors {
67 fill: root
68 margins: -units.gu(2)
69 }
70 source: "graphics/dropshadow2gu.sci"
71 opacity: root.shadowOpacity * .3
72 }
73
74 Rectangle {
75 id: selectionHighlight
76 anchors.fill: parent
77 anchors.margins: -units.gu(1)
78 color: "white"
79 opacity: highlightShown ? 0.55 : 0
80 antialiasing: true
81 }
82
83 Rectangle {
84 anchors { left: selectionHighlight.left; right: selectionHighlight.right; bottom: selectionHighlight.bottom; }
85 height: units.dp(2)
86 color: theme.palette.normal.focus
87 visible: root.highlightShown
88 antialiasing: true
89 }
90
91 Item {
92 id: clipper
93 anchors.fill: parent
94
95 ApplicationWindow {
96 id: applicationWindow
97 objectName: application ? "appWindow_" + application.appId : "appWindow_null"
98 anchors.top: parent.top
99 anchors.topMargin: 0
100 anchors.left: parent.left
101 width: root.windowWidth
102 height: root.windowHeight
103 interactive: false
104 resizeSurface: false
105 focus: false
106
107 property real itemScale: 1
108 transform: [
109 Scale {
110 origin.x: 0; origin.y: 0
111 xScale: applicationWindow.itemScale
112 yScale: applicationWindow.itemScale
113 }
114 ]
115 }
116 }
117
118 Rectangle {
119 anchors.fill: parent
120 color: "black"
121 opacity: root.highlightShown ? 0 : .1
122 Behavior on opacity {
123 UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration }
124 }
125 }
126}
1270
=== removed file 'qml/Stages/PhoneStage.qml'
--- qml/Stages/PhoneStage.qml 2016-08-08 11:18:19 +0000
+++ qml/Stages/PhoneStage.qml 1970-01-01 00:00:00 +0000
@@ -1,806 +0,0 @@
1/*
2 * Copyright (C) 2014-2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches