Merge lp:~aacid/unity8/desktopRotatedCamera into lp:unity8

Proposed by Albert Astals Cid
Status: Superseded
Proposed branch: lp:~aacid/unity8/desktopRotatedCamera
Merge into: lp:unity8
Diff against target: 2267 lines (+1060/-168)
18 files modified
data/com.canonical.Unity8.gschema.xml (+11/-0)
qml/Components/PhysicalKeysMapper.qml (+24/-0)
qml/Launcher/Launcher.qml (+141/-9)
qml/Launcher/LauncherDelegate.qml (+54/-20)
qml/Launcher/LauncherPanel.qml (+122/-51)
qml/Launcher/graphics/launcher-app-focus-ring.svg (+12/-0)
qml/Shell.qml (+51/-1)
qml/Stages/AbstractStage.qml (+2/-0)
qml/Stages/DecoratedWindow.qml (+27/-10)
qml/Stages/DesktopStage.qml (+49/-18)
qml/Stages/WindowResizeArea.qml (+7/-4)
tests/mocks/GSettings.1.0/fake_gsettings.cpp (+64/-0)
tests/mocks/GSettings.1.0/fake_gsettings.h (+18/-0)
tests/mocks/Unity/Application/ApplicationManager.cpp (+12/-0)
tests/mocks/Unity/Launcher/MockLauncherModel.cpp (+5/-0)
tests/qmltests/Launcher/tst_Launcher.qml (+244/-18)
tests/qmltests/tst_OrientedShell.qml (+13/-1)
tests/qmltests/tst_Shell.qml (+204/-36)
To merge this branch: bzr merge lp:~aacid/unity8/desktopRotatedCamera
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+287137@code.launchpad.net

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

Commit message

Desktop stage: Support rotatesWindowContents

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

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

PASSED: Continuous integration, rev:2205
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/481/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/643
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/209
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/209
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/666
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/684
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/684
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/680
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/680/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/680
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/680/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/680
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/680/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/680
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/680/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/680
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/680/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/680
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/680/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2205
http://jenkins.qa.ubuntu.com/job/unity8-ci/7411/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6628
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/826/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2116
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/819
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/2011
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/2011
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/818
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/817
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/5031
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6639
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6639/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27879
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/424/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/824
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/824/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27878

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7411/rebuild

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

FAILED: Continuous integration, rev:2206
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/499/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/663
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/227
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/227
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/229
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/229
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/686
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/704
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/704
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/700
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/700/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/700
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/700/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/700
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/700/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/700
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/700/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/700
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/700/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/700
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/700/artifact/output/*zip*/output.zip

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

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

Left some inline comments, also seems you want to rotate just the ApplicationWindow inside the delegate, why not do it directly there instead of doing the calculations to take the decoration into account?

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

Also, shouldn't there be some transition/animation when the window rotates?

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2206
http://jenkins.qa.ubuntu.com/job/unity8-ci/7429/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6659
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/844/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2134
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/837
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/2029
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/2029
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/836
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/835
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/5053
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6670
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6670/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27923
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/441/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/842
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/842/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27922

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7429/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

> Left some inline comments, also seems you want to rotate just the
> ApplicationWindow inside the delegate, why not do it directly there instead of
> doing the calculations to take the decoration into account?

Yes, only the ApplicationWindow needs rotating and that's what i'm rotating only, no? I'm not sure what you mean with "there" means as instead of what i'm doing now.

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Also, shouldn't there be some transition/animation when the window rotates?

The window doesn't really rotate, you move the phone and the window stays "the same" visually

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

> > Left some inline comments, also seems you want to rotate just the
> > ApplicationWindow inside the delegate, why not do it directly there instead
> of
> > doing the calculations to take the decoration into account?
>
> Yes, only the ApplicationWindow needs rotating and that's what i'm rotating
> only, no? I'm not sure what you mean with "there" means as instead of what i'm
> doing now.

Yup sorry, that's what I meant, blaming launchpad diff for not being to show/expand the context...

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Why not just use "rotation: rotationAngle" instead of constructing the Rotation Transform? The "transformOrigin" is by default Item.Center

Because it doesn't work, see current code http://i.imgur.com/SeDA0n4.png vs using rotation as you say http://i.imgur.com/ptyxvQL.png

You need the correct origin otherwise the rotation sends the item away from the rest of the item

Revision history for this message
Albert Astals Cid (aacid) wrote :

> What about other states like "maximized", shouldn't we care about them as well?

They do work already, see tryOrientedShell, mako, windowed, start the second camera app and maximize it, then go to invertedlandscape and see how it works fine

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

FAILED: Continuous integration, rev:2208
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/501/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/665
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/231
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/231
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/688
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/706
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/706
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/702/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/702
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/702/artifact/output/*zip*/output.zip

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

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

Maybe we would make camera-app not be fullscreen when in desktop mode (have code somewhere calling cameraApplication->setFullcreen(false)) instead of creating another app.

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

Good work, by the way. Completely forgot about implementing RotatesWindowContents in DesktopStage.

Another thing:
"""
{tag: "mako_windowed", deviceName: "mako", orientationAngleAfterRotation: 90, windowed: true},
"""

Wouldn't a "manta_windowed" make more sense? (larger display area)

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

> Maybe we would make camera-app not be fullscreen when in desktop mode (have
> code somewhere calling cameraApplication->setFullcreen(false)) instead of
> creating another app.

By the way, that would mimic the magic that will (or already does, don't recall trying) happen on the device.

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Wouldn't a "manta_windowed" make more sense? (larger display area)

Does it matter? I guess the point is that it works on one it "should" work on all, maybe i can just add all three?

Revision history for this message
Albert Astals Cid (aacid) wrote :

> Maybe we would make camera-app not be fullscreen when in desktop mode (have code somewhere
> calling cameraApplication->setFullcreen(false)) instead of creating another app.

This has advantage that we kind of test the "same" camera app that we [will] have on the real world, the disadvantage is that we lose the hability to try/test pure fullscreen apps on the destkop stage (which i guess at some point makes sense too).

That's why i decided to go for the duplication case, but can make it the other way if you prefer.

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

On 26/02/2016 10:36, Albert Astals Cid wrote:
>> Wouldn't a "manta_windowed" make more sense? (larger display area)
> Does it matter? I guess the point is that it works on one it "should" work on all, maybe i can just add all three?

just sugar on top. makes more sense when you look at it or try it out
manually.

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

On 26/02/2016 10:43, Albert Astals Cid wrote:
> This has advantage that we kind of test the "same" camera app that we [will] have on the real world, the disadvantage is that we lose the hability to try/test pure fullscreen apps on the destkop stage (which i guess at some point makes sense too).

We already have other fullscreen apps there: gallery-app, webbrowser-app

Revision history for this message
Albert Astals Cid (aacid) wrote :

> We already have other fullscreen apps there: gallery-app, webbrowser-app

Sure, but they do not have rotatesWindowContents set

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2208
http://jenkins.qa.ubuntu.com/job/unity8-ci/7430/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6660
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/845/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2135
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/838
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/2030
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/2030
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/837
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/836
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/5054
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6671
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6671/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27925
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/442/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/843
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/843/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27924

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7430/rebuild

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

FAILED: Continuous integration, rev:2210
https://unity8-jenkins.ubuntu.com/job/lp-unity8-1-ci/504/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/668
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay/237
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial/237
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay/238
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/691
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/709
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/709
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/705
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/705/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/705
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/705/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/705
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/705/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/705
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/705/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/705
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/705/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/705
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/705/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2210
http://jenkins.qa.ubuntu.com/job/unity8-ci/7432/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/6663
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/847/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/2137
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/840
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/2032
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/2032
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/839
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/838
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/5058
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6674
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/6674/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27930
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/444/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/845
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/845/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/27929

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7432/rebuild

review: Needs Fixing (continuous-integration)
2091. By Lukáš Tinkl

fix for fullscreen apps in desktop mode

2092. By Lukáš Tinkl

similar fix to height...

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

Worked fine from my testing

* Did you perform an exploratory manual test run of the code change and any related functionality?

Yes

* Did CI run pass? If not, please explain why.

Yes, unrelated failures

* Did you make sure that the branch does not contain spurious tags?

Yes

review: Approve
2093. By Albert Astals Cid

Desktop stage: Support rotatesWindowContents

2094. By Albert Astals Cid

Make it work on non fullscreen windows too

2095. By Albert Astals Cid

Add SurfaceManagerControls

2096. By Albert Astals Cid

These are readonly too (i think)

2097. By Albert Astals Cid

add the other two windowed variants too

2098. By Albert Astals Cid

also switch the min/maxwidth/height

2099. By Albert Astals Cid

Merge makeMakeTryOrientedShellWork

2100. By Albert Astals Cid

account for 180

2101. By Albert Astals Cid

Merge

2102. By Albert Astals Cid

Merge

2103. By Albert Astals Cid

Merge

2104. By Albert Astals Cid

Change to windowed/not windowed before starting the app

2105. By Albert Astals Cid

Merge

2106. By Albert Astals Cid

Merge

2107. By Albert Astals Cid

"compile"

2108. By Albert Astals Cid

fix startup of non rotatesWindowContents apps

2109. By Albert Astals Cid

Revert change infected from other branch

2110. By Albert Astals Cid

Merge

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/com.canonical.Unity8.gschema.xml'
--- data/com.canonical.Unity8.gschema.xml 2015-11-24 17:44:18 +0000
+++ data/com.canonical.Unity8.gschema.xml 2016-03-10 09:37:58 +0000
@@ -27,6 +27,17 @@
27 <summary>Maximum push needed to overcome edge barrier</summary>27 <summary>Maximum push needed to overcome edge barrier</summary>
28 <description>How much you have to push (in grid units) the mouse against an edge barrier when sensibility is 1.</description>28 <description>How much you have to push (in grid units) the mouse against an edge barrier when sensibility is 1.</description>
29 </key>29 </key>
30 <key type="b" name="autohide-launcher">
31 <default>true</default>
32 <summary>Autohide the launcher</summary>
33 <description>This will only be applied in windowed mode. In staged mode, the launcher will always hide.</description>
34 </key>
35 <key type="u" name="launcher-width">
36 <default>8</default>
37 <range min="6" max="12"/>
38 <summary>Width of the launcher in grid units.</summary>
39 <description>Changes the width of the launcher in all usage modes.</description>
40 </key>
30 </schema>41 </schema>
3142
32 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">43 <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8">
3344
=== modified file 'qml/Components/PhysicalKeysMapper.qml'
--- qml/Components/PhysicalKeysMapper.qml 2016-01-13 18:43:34 +0000
+++ qml/Components/PhysicalKeysMapper.qml 2016-03-10 09:37:58 +0000
@@ -42,12 +42,15 @@
42 signal screenshotTriggered;42 signal screenshotTriggered;
4343
44 readonly property bool altTabPressed: d.altTabPressed44 readonly property bool altTabPressed: d.altTabPressed
45 readonly property bool superPressed: d.superPressed
46 readonly property bool superTabPressed: d.superTabPressed
4547
46 property int powerKeyLongPressTime: 200048 property int powerKeyLongPressTime: 2000
4749
48 // For testing. If running windowed (e.g. tryShell), Alt+Tab is taken by the50 // For testing. If running windowed (e.g. tryShell), Alt+Tab is taken by the
49 // running desktop, set this to true to use Ctrl+Tab instead.51 // running desktop, set this to true to use Ctrl+Tab instead.
50 property bool controlInsteadOfAlt: false52 property bool controlInsteadOfAlt: false
53 property bool controlInsteadOfSuper: false
5154
52 QtObject {55 QtObject {
53 id: d56 id: d
@@ -59,6 +62,9 @@
59 property bool altPressed: false62 property bool altPressed: false
60 property bool altTabPressed: false63 property bool altTabPressed: false
6164
65 property bool superPressed: false
66 property bool superTabPressed: false
67
62 property var powerButtonPressStart: 068 property var powerButtonPressStart: 0
6369
64 // We need to eat ALT presses until we know what they're for (Alt+Tab or going to the app?)70 // We need to eat ALT presses until we know what they're for (Alt+Tab or going to the app?)
@@ -119,11 +125,23 @@
119 event.accepted = true;125 event.accepted = true;
120 d.altPressInjected = false;126 d.altPressInjected = false;
121 }127 }
128
129 // Adding MetaModifier here because that's what keyboards do. Pressing Super_L actually gives
130 // Super_L + MetaModifier. This helps to make sure we only invoke superPressed if no other
131 // Modifier is pressed too.
132 } else if (((event.key == Qt.Key_Super_L || event.key == Qt.Key_Super_R) && event.modifiers === Qt.MetaModifier)
133 || (root.controlInsteadOfSuper && event.key == Qt.Key_Control)
134 ) {
135 d.superPressed = true;
122 } else if (event.key == Qt.Key_Tab) {136 } else if (event.key == Qt.Key_Tab) {
123 if (d.altPressed && !d.altTabPressed) {137 if (d.altPressed && !d.altTabPressed) {
124 d.altTabPressed = true;138 d.altTabPressed = true;
125 event.accepted = true;139 event.accepted = true;
126 }140 }
141 if (d.superPressed && !d.superTabPressed) {
142 d.superTabPressed = true;
143 event.accepted = true;
144 }
127 }145 }
128 }146 }
129147
@@ -154,6 +172,12 @@
154 if (d.altTabPressed) {172 if (d.altTabPressed) {
155 event.accepted = true;173 event.accepted = true;
156 }174 }
175 } else if (event.key == Qt.Key_Super_L || event.key == Qt.Key_Super_R || (root.controlInsteadOfSuper && event.key == Qt.Key_Control)) {
176 d.superPressed = false;
177 if (d.superTabPressed) {
178 d.superTabPressed = false;
179 event.accepted = true;
180 }
157 }181 }
158 }182 }
159}183}
160184
=== modified file 'qml/Launcher/Launcher.qml'
--- qml/Launcher/Launcher.qml 2016-01-19 15:26:15 +0000
+++ qml/Launcher/Launcher.qml 2016-03-10 09:37:58 +0000
@@ -19,21 +19,26 @@
19import Ubuntu.Components 1.319import Ubuntu.Components 1.3
20import Ubuntu.Gestures 0.120import Ubuntu.Gestures 0.1
21import Unity.Launcher 0.121import Unity.Launcher 0.1
22import GlobalShortcut 1.0
2223
23Item {24FocusScope {
24 id: root25 id: root
2526
26 property bool autohideEnabled: false27 property bool autohideEnabled: false
28 property bool lockedVisible: false
27 property bool available: true // can be used to disable all interactions29 property bool available: true // can be used to disable all interactions
28 property alias inverted: panel.inverted30 property alias inverted: panel.inverted
29 property bool shadeBackground: true // can be used to disable background shade when launcher is visible31 property bool shadeBackground: true // can be used to disable background shade when launcher is visible
3032
31 property int panelWidth: units.gu(8)33 property int panelWidth: units.gu(10)
32 property int dragAreaWidth: units.gu(1)34 property int dragAreaWidth: units.gu(1)
33 property int minimizeDistance: units.gu(26)35 property int minimizeDistance: units.gu(26)
34 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?36 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
35 (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 037 (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 0
3638
39 property bool superPressed: false
40 property bool superTabPressed: false
41
37 readonly property bool dragging: dragArea.dragging42 readonly property bool dragging: dragArea.dragging
38 readonly property real dragDistance: dragArea.dragging ? dragArea.touchX : 043 readonly property real dragDistance: dragArea.dragging ? dragArea.touchX : 0
39 readonly property real visibleWidth: panel.width + panel.x44 readonly property real visibleWidth: panel.width + panel.x
@@ -57,12 +62,55 @@
57 }62 }
58 }63 }
5964
65 onSuperPressedChanged: {
66 if (superPressed) {
67 superPressTimer.start();
68 superLongPressTimer.start();
69 } else {
70 superPressTimer.stop();
71 superLongPressTimer.stop();
72 launcher.switchToNextState("");
73 panel.shortcutHintsShown = false;
74 }
75 }
76
77 onSuperTabPressedChanged: {
78 if (superTabPressed) {
79 switchToNextState("visible")
80 panel.highlightIndex = -1;
81 root.focus = true;
82 superPressTimer.stop();
83 superLongPressTimer.stop();
84 } else {
85 if (panel.highlightIndex == -1) {
86 showDashHome();
87 } else if (panel.highlightIndex >= 0){
88 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
89 }
90 panel.highlightIndex = -2;
91 switchToNextState("");
92 root.focus = false;
93 }
94 }
95
96 onLockedVisibleChanged: {
97 if (lockedVisible && state == "") {
98 panel.dismissTimer.stop();
99 fadeOutAnimation.stop();
100 switchToNextState("visible")
101 } else if (!lockedVisible && state == "visible") {
102 hide();
103 }
104 }
105
60 function hide() {106 function hide() {
61 switchToNextState("")107 switchToNextState("")
62 }108 }
63109
64 function fadeOut() {110 function fadeOut() {
65 fadeOutAnimation.start();111 if (!root.lockedVisible) {
112 fadeOutAnimation.start();
113 }
66 }114 }
67115
68 function switchToNextState(state) {116 function switchToNextState(state) {
@@ -90,6 +138,76 @@
90 }138 }
91 }139 }
92140
141 function openForKeyboardNavigation() {
142 panel.highlightIndex = -1; // The BFB
143 root.focus = true;
144 switchToNextState("visible")
145 }
146
147 Keys.onPressed: {
148 switch (event.key) {
149 case Qt.Key_Backtab:
150 panel.highlightPrevious();
151 event.accepted = true;
152 break;
153 case Qt.Key_Up:
154 if (root.inverted) {
155 panel.highlightNext()
156 } else {
157 panel.highlightPrevious();
158 }
159 event.accepted = true;
160 break;
161 case Qt.Key_Tab:
162 panel.highlightNext();
163 event.accepted = true;
164 break;
165 case Qt.Key_Down:
166 if (root.inverted) {
167 panel.highlightPrevious();
168 } else {
169 panel.highlightNext();
170 }
171 event.accepted = true;
172 break;
173 case Qt.Key_Right:
174 panel.openQuicklist(panel.highlightIndex)
175 event.accepted = true;
176 break;
177 case Qt.Key_Escape:
178 panel.highlightIndex = -2
179 // Falling through intentionally
180 case Qt.Key_Enter:
181 case Qt.Key_Return:
182 case Qt.Key_Space:
183 if (panel.highlightIndex == -1) {
184 showDashHome();
185 } else if (panel.highlightIndex >= 0) {
186 launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId);
187 }
188 root.hide();
189 event.accepted = true;
190 root.focus = false;
191 }
192 }
193
194 Timer {
195 id: superPressTimer
196 interval: 200
197 onTriggered: {
198 switchToNextState("visible")
199 }
200 }
201
202 Timer {
203 id: superLongPressTimer
204 interval: 1000
205 onTriggered: {
206 switchToNextState("visible")
207 panel.shortcutHintsShown = true;
208 }
209 }
210
93 Timer {211 Timer {
94 id: teaseTimer212 id: teaseTimer
95 interval: mode == "teasing" ? 200 : 300213 interval: mode == "teasing" ? 200 : 300
@@ -106,6 +224,13 @@
106 interval: 1224 interval: 1
107 property string nextState: ""225 property string nextState: ""
108 onTriggered: {226 onTriggered: {
227 if (root.lockedVisible && nextState == "") {
228 // Due to binding updates when switching between modes
229 // it could happen that our request to show will be overwritten
230 // with a hide request. Rewrite it when we know hiding is not allowed.
231 nextState = "visible"
232 }
233
109 // switching to an intermediate state here to make sure all the234 // switching to an intermediate state here to make sure all the
110 // values are restored, even if we were already in the target state235 // values are restored, even if we were already in the target state
111 root.state = "tmp"236 root.state = "tmp"
@@ -151,7 +276,7 @@
151276
152 MouseArea {277 MouseArea {
153 id: launcherDragArea278 id: launcherDragArea
154 enabled: root.available && (root.state == "visible" || root.state == "visibleTemporary")279 enabled: root.available && (root.state == "visible" || root.state == "visibleTemporary") && !root.lockedVisible
155 anchors.fill: panel280 anchors.fill: panel
156 anchors.rightMargin: -units.gu(2)281 anchors.rightMargin: -units.gu(2)
157 drag {282 drag {
@@ -172,9 +297,10 @@
172 InverseMouseArea {297 InverseMouseArea {
173 id: closeMouseArea298 id: closeMouseArea
174 anchors.fill: panel299 anchors.fill: panel
175 enabled: root.shadeBackground && root.state == "visible"300 enabled: root.shadeBackground && root.state == "visible" && (!root.lockedVisible || panel.highlightIndex >= -1)
176 visible: enabled301 visible: enabled
177 onPressed: {302 onPressed: {
303 panel.highlightIndex = -2
178 root.hide();304 root.hide();
179 }305 }
180 }306 }
@@ -183,7 +309,7 @@
183 id: backgroundShade309 id: backgroundShade
184 anchors.fill: parent310 anchors.fill: parent
185 color: "black"311 color: "black"
186 opacity: root.shadeBackground && root.state == "visible" ? 0.6 : 0312 opacity: root.shadeBackground && root.state == "visible" && !root.lockedVisible ? 0.6 : 0
187313
188 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }314 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } }
189 }315 }
@@ -227,7 +353,7 @@
227 Connections {353 Connections {
228 target: panel.dismissTimer354 target: panel.dismissTimer
229 onTriggered: {355 onTriggered: {
230 if (root.autohideEnabled) {356 if (root.autohideEnabled && !root.lockedVisible) {
231 if (!panel.preventHiding) {357 if (!panel.preventHiding) {
232 root.state = ""358 root.state = ""
233 } else {359 } else {
@@ -240,11 +366,11 @@
240 property bool animate: true366 property bool animate: true
241367
242 onApplicationSelected: {368 onApplicationSelected: {
243 root.state = ""369 root.hide();
244 launcherApplicationSelected(appId)370 launcherApplicationSelected(appId)
245 }371 }
246 onShowDashHome: {372 onShowDashHome: {
247 root.state = ""373 root.hide();
248 root.showDashHome();374 root.showDashHome();
249 }375 }
250376
@@ -254,6 +380,12 @@
254 }380 }
255 }381 }
256382
383 onKbdNavigationCancelled: {
384 panel.highlightIndex = -2;
385 root.hide();
386 root.focus = false;
387 }
388
257 Behavior on x {389 Behavior on x {
258 enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;390 enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;
259 NumberAnimation {391 NumberAnimation {
260392
=== modified file 'qml/Launcher/LauncherDelegate.qml'
--- qml/Launcher/LauncherDelegate.qml 2015-11-19 16:55:31 +0000
+++ qml/Launcher/LauncherDelegate.qml 2016-03-10 09:37:58 +0000
@@ -20,6 +20,7 @@
20Item {20Item {
21 id: root21 id: root
2222
23 property int itemIndex: 0
23 property string iconName24 property string iconName
24 property int count: 025 property int count: 0
25 property bool countVisible: false26 property bool countVisible: false
@@ -29,10 +30,12 @@
29 property real maxAngle: 030 property real maxAngle: 0
30 property bool inverted: false31 property bool inverted: false
31 property bool alerting: false32 property bool alerting: false
32 readonly property alias wiggling: wiggleAnim.running33 property bool highlighted: false
34 property bool shortcutHintShown: false
3335
34 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight36 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
35 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight37 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
38 readonly property alias wiggling: wiggleAnim.running
3639
37 property int itemWidth40 property int itemWidth
38 property int itemHeight41 property int itemHeight
@@ -121,14 +124,25 @@
121124
122 Item {125 Item {
123 id: iconItem126 id: iconItem
124 width: parent.itemWidth + units.gu(1)127 width: root.width
125 height: parent.itemHeight + units.gu(1)128 height: parent.itemHeight + units.gu(1)
126 anchors.centerIn: parent129 anchors.centerIn: parent
127130
131 Image {
132 objectName: "focusRing"
133 anchors.centerIn: iconShape
134 height: width * 15 / 16
135 width: iconShape.width + units.gu(1)
136 source: "graphics/launcher-app-focus-ring.svg"
137 sourceSize.width: width
138 sourceSize.height: height
139 visible: root.highlighted
140 }
141
128 ProportionalShape {142 ProportionalShape {
129 id: iconShape143 id: iconShape
130 anchors.centerIn: parent144 anchors.centerIn: parent
131 width: parent.width - units.gu(2)145 width: root.itemWidth
132 aspect: UbuntuShape.DropShadow146 aspect: UbuntuShape.DropShadow
133 source: Image {147 source: Image {
134 id: iconImage148 id: iconImage
@@ -144,7 +158,8 @@
144 anchors {158 anchors {
145 right: parent.right159 right: parent.right
146 bottom: parent.bottom160 bottom: parent.bottom
147 margins: units.dp(3)161 rightMargin: (iconItem.width - root.itemWidth) / 2 - units.dp(2)
162 margins: units.dp(5)
148 }163 }
149 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))164 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
150 height: units.gu(2)165 height: units.gu(2)
@@ -172,16 +187,11 @@
172 id: progressOverlay187 id: progressOverlay
173 objectName: "progressOverlay"188 objectName: "progressOverlay"
174189
175 anchors {190 anchors.centerIn: parent
176 left: iconItem.left191 width: root.itemWidth * .8
177 right: iconItem.right
178 verticalCenter: parent.verticalCenter
179 leftMargin: units.gu(1.5)
180 rightMargin: units.gu(1.5)
181 }
182 height: units.gu(1)192 height: units.gu(1)
183 visible: root.progress > -1193 visible: root.progress > -1
184 color: UbuntuColors.darkGrey194 backgroundColor: UbuntuColors.darkGrey
185 borderSource: "none"195 borderSource: "none"
186196
187 Item {197 Item {
@@ -199,32 +209,56 @@
199 top: parent.top209 top: parent.top
200 bottom: parent.bottom210 bottom: parent.bottom
201 }211 }
202 color: "white"212 backgroundColor: "white"
203 borderSource: "none"213 borderSource: "none"
204 width: progressOverlay.width214 width: progressOverlay.width
205 }215 }
206 }216 }
207 }217 }
208218
209 Image {219 Column {
210 objectName: "runningHighlight"
211 anchors {220 anchors {
212 left: parent.left221 left: parent.left
213 verticalCenter: parent.verticalCenter222 verticalCenter: parent.verticalCenter
214 }223 }
215 visible: root.itemRunning224 spacing: units.gu(.5)
216 rotation: 180225 Repeater {
217 source: "graphics/focused_app_arrow.png"226 model: 1 // TODO: This should be "Math.min(3, app.surfaceCount)" once we have multiple surfaces
227 Rectangle {
228 objectName: "runningHighlight" + index
229 width: units.gu(0.25)
230 height: units.gu(.5)
231 color: "white"
232 visible: root.itemRunning
233 }
234 }
218 }235 }
219236
220 Image {237 Rectangle {
221 objectName: "focusedHighlight"238 objectName: "focusedHighlight"
222 anchors {239 anchors {
223 right: parent.right240 right: parent.right
224 verticalCenter: parent.verticalCenter241 verticalCenter: parent.verticalCenter
225 }242 }
243 width: units.gu(0.25)
244 height: units.gu(.5)
245 color: "white"
226 visible: root.itemFocused246 visible: root.itemFocused
227 source: "graphics/focused_app_arrow.png"247 }
248
249 Rectangle {
250 objectName: "shortcutHint"
251 anchors.centerIn: parent
252 width: units.gu(3)
253 height: width
254 color: "#E0292929"
255 visible: root.shortcutHintShown
256 Label {
257 anchors.centerIn: parent
258 text: (itemIndex + 1) % 10
259 color: "white"
260 font.weight: Font.DemiBold
261 }
228 }262 }
229 }263 }
230264
231265
=== modified file 'qml/Launcher/LauncherPanel.qml'
--- qml/Launcher/LauncherPanel.qml 2016-01-11 17:38:19 +0000
+++ qml/Launcher/LauncherPanel.qml 2016-03-10 09:37:58 +0000
@@ -19,12 +19,13 @@
19import Ubuntu.Components.ListItems 1.3 as ListItems19import Ubuntu.Components.ListItems 1.3 as ListItems
20import Unity.Launcher 0.120import Unity.Launcher 0.1
21import Ubuntu.Components.Popups 1.321import Ubuntu.Components.Popups 1.3
22import GlobalShortcut 1.0
22import "../Components/ListItems"23import "../Components/ListItems"
23import "../Components/"24import "../Components/"
2425
25Rectangle {26Rectangle {
26 id: root27 id: root
27 color: "#B2000000"28 color: "#E0292929"
2829
29 rotation: inverted ? 180 : 030 rotation: inverted ? 180 : 0
3031
@@ -33,11 +34,13 @@
33 property bool dragging: false34 property bool dragging: false
34 property bool moving: launcherListView.moving || launcherListView.flicking35 property bool moving: launcherListView.moving || launcherListView.flicking
35 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed36 property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed
36 || mouseEventEater.containsMouse || dashItem.hovered37 || mouseEventEater.containsMouse || dashItem.hovered
37 property int highlightIndex: -138 property int highlightIndex: -2
39 property bool shortcutHintsShown: false
3840
39 signal applicationSelected(string appId)41 signal applicationSelected(string appId)
40 signal showDashHome()42 signal showDashHome()
43 signal kbdNavigationCancelled()
4144
42 onXChanged: {45 onXChanged: {
43 if (quickList.state == "open") {46 if (quickList.state == "open") {
@@ -45,6 +48,26 @@
45 }48 }
46 }49 }
4750
51 function highlightNext() {
52 highlightIndex++;
53 if (highlightIndex >= launcherListView.count) {
54 highlightIndex = -1;
55 }
56 launcherListView.moveToIndex(Math.max(highlightIndex, 0));
57 }
58 function highlightPrevious() {
59 highlightIndex--;
60 if (highlightIndex <= -2) {
61 highlightIndex = launcherListView.count - 1;
62 }
63 launcherListView.moveToIndex(Math.max(highlightIndex, 0));
64 }
65 function openQuicklist(index) {
66 quickList.open(index);
67 quickList.selectedIndex = 0;
68 quickList.focus = true;
69 }
70
48 MouseArea {71 MouseArea {
49 id: mouseEventEater72 id: mouseEventEater
50 anchors.fill: parent73 anchors.fill: parent
@@ -57,24 +80,16 @@
57 fill: parent80 fill: parent
58 }81 }
5982
60 Item {83 Rectangle {
61 objectName: "buttonShowDashHome"84 objectName: "buttonShowDashHome"
62 width: parent.width85 width: parent.width
63 height: units.gu(7)86 height: width * .9
64 clip: true87 color: UbuntuColors.orange
6588 readonly property bool highlighted: root.highlightIndex == -1;
66 UbuntuShape {
67 anchors {
68 fill: parent
69 topMargin: -units.gu(2)
70 }
71 aspect: UbuntuShape.Flat
72 backgroundColor: UbuntuColors.orange
73 }
7489
75 Image {90 Image {
76 objectName: "dashItem"91 objectName: "dashItem"
77 width: units.gu(5)92 width: parent.width * .6
78 height: width93 height: width
79 anchors.centerIn: parent94 anchors.centerIn: parent
80 source: "graphics/home.png"95 source: "graphics/home.png"
@@ -85,6 +100,14 @@
85 anchors.fill: parent100 anchors.fill: parent
86 onClicked: root.showDashHome()101 onClicked: root.showDashHome()
87 }102 }
103 Rectangle {
104 objectName: "bfbFocusHighlight"
105 anchors.fill: parent
106 border.color: "white"
107 border.width: units.dp(1)
108 color: "transparent"
109 visible: parent.highlighted
110 }
88 }111 }
89112
90 Item {113 Item {
@@ -102,10 +125,8 @@
102 objectName: "launcherListView"125 objectName: "launcherListView"
103 anchors {126 anchors {
104 fill: parent127 fill: parent
105 topMargin: -extensionSize + units.gu(0.5)128 topMargin: -extensionSize + width * .15
106 bottomMargin: -extensionSize + units.gu(1)129 bottomMargin: -extensionSize + width * .15
107 leftMargin: units.gu(0.5)
108 rightMargin: units.gu(0.5)
109 }130 }
110 topMargin: extensionSize131 topMargin: extensionSize
111 bottomMargin: extensionSize132 bottomMargin: extensionSize
@@ -140,11 +161,11 @@
140 }161 }
141162
142 // The height of the area where icons start getting folded163 // The height of the area where icons start getting folded
143 property int foldingStartHeight: units.gu(6.5)164 property int foldingStartHeight: itemHeight
144 // The height of the area where the items reach the final folding angle165 // The height of the area where the items reach the final folding angle
145 property int foldingStopHeight: foldingStartHeight - itemHeight - spacing166 property int foldingStopHeight: foldingStartHeight - itemHeight - spacing
146 property int itemWidth: units.gu(7)167 property int itemWidth: width * .75
147 property int itemHeight: units.gu(6.5)168 property int itemHeight: itemWidth * 15 / 16 + units.gu(1)
148 property int clickFlickSpeed: units.gu(60)169 property int clickFlickSpeed: units.gu(60)
149 property int draggedIndex: dndArea.draggedIndex170 property int draggedIndex: dndArea.draggedIndex
150 property real realContentY: contentY - originY + topMargin171 property real realContentY: contentY - originY + topMargin
@@ -172,12 +193,24 @@
172193
173 UbuntuNumberAnimation {194 UbuntuNumberAnimation {
174 id: moveAnimation195 id: moveAnimation
196 objectName: "moveAnimation"
175 target: launcherListView197 target: launcherListView
176 property: "contentY"198 property: "contentY"
177 function moveTo(contentY) {199 function moveTo(contentY) {
178 from = launcherListView.contentY;200 from = launcherListView.contentY;
179 to = contentY;201 to = contentY;
180 start();202 restart();
203 }
204 }
205 function moveToIndex(index) {
206 var totalItemHeight = launcherListView.itemHeight + launcherListView.spacing
207 var itemPosition = index * totalItemHeight;
208 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
209 var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : totalItemHeight
210 if (itemPosition + totalItemHeight + distanceToEnd > launcherListView.contentY + launcherListView.originY + launcherListView.topMargin + height) {
211 moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd - launcherListView.originY);
212 } else if (itemPosition - distanceToEnd < launcherListView.contentY - launcherListView.originY + launcherListView.topMargin) {
213 moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin + launcherListView.originY);
181 }214 }
182 }215 }
183216
@@ -192,9 +225,10 @@
192 // the right app when running autopilot tests for225 // the right app when running autopilot tests for
193 // multiple apps.226 // multiple apps.
194 readonly property string appId: model.appId227 readonly property string appId: model.appId
228 itemIndex: index
195 itemHeight: launcherListView.itemHeight229 itemHeight: launcherListView.itemHeight
196 itemWidth: launcherListView.itemWidth230 itemWidth: launcherListView.itemWidth
197 width: itemWidth231 width: parent.width
198 height: itemHeight232 height: itemHeight
199 iconName: model.icon233 iconName: model.icon
200 count: model.count234 count: model.count
@@ -204,6 +238,8 @@
204 itemFocused: model.focused238 itemFocused: model.focused
205 inverted: root.inverted239 inverted: root.inverted
206 alerting: model.alerting240 alerting: model.alerting
241 highlighted: root.highlightIndex == index
242 shortcutHintShown: root.shortcutHintsShown && index <= 9
207 z: -Math.abs(offset)243 z: -Math.abs(offset)
208 maxAngle: 55244 maxAngle: 55
209 property bool dragging: false245 property bool dragging: false
@@ -241,14 +277,7 @@
241 onAlertingChanged: {277 onAlertingChanged: {
242 if(alerting) {278 if(alerting) {
243 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {279 if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) {
244 var itemPosition = index * launcherListView.itemHeight;280 launcherListView.moveToIndex(index)
245 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
246 var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : launcherListView.itemHeight
247 if (itemPosition + launcherListView.itemHeight + distanceToEnd > launcherListView.contentY + launcherListView.topMargin + height) {
248 moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd);
249 } else if (itemPosition - distanceToEnd < launcherListView.contentY + launcherListView.topMargin) {
250 moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin);
251 }
252 if (!dragging && launcher.state !== "visible") {281 if (!dragging && launcher.state !== "visible") {
253 peekingAnimation.start()282 peekingAnimation.start()
254 }283 }
@@ -402,10 +431,7 @@
402431
403 if (mouse.button & Qt.RightButton) { // context menu432 if (mouse.button & Qt.RightButton) { // context menu
404 // Opening QuickList433 // Opening QuickList
405 quickList.item = clickedItem;434 quickList.open(index);
406 quickList.model = launcherListView.model.get(index).quickList;
407 quickList.appId = launcherListView.model.get(index).appId;
408 quickList.state = "open";
409 return;435 return;
410 }436 }
411437
@@ -413,10 +439,8 @@
413439
414 // First/last item do the scrolling at more than 12 degrees440 // First/last item do the scrolling at more than 12 degrees
415 if (index == 0 || index == launcherListView.count - 1) {441 if (index == 0 || index == launcherListView.count - 1) {
416 if (clickedItem.angle > 12) {442 if (clickedItem.angle > 12 || clickedItem.angle < -12) {
417 launcherListView.flick(0, -launcherListView.clickFlickSpeed);443 launcherListView.moveToIndex(index);
418 } else if (clickedItem.angle < -12) {
419 launcherListView.flick(0, launcherListView.clickFlickSpeed);
420 } else {444 } else {
421 root.applicationSelected(LauncherModel.get(index).appId);445 root.applicationSelected(LauncherModel.get(index).appId);
422 }446 }
@@ -424,10 +448,8 @@
424 }448 }
425449
426 // the rest launches apps up to an angle of 30 degrees450 // the rest launches apps up to an angle of 30 degrees
427 if (clickedItem.angle > 30) {451 if (clickedItem.angle > 30 || clickedItem.angle < -30) {
428 launcherListView.flick(0, -launcherListView.clickFlickSpeed);452 launcherListView.moveToIndex(index);
429 } else if (clickedItem.angle < -30) {
430 launcherListView.flick(0, launcherListView.clickFlickSpeed);
431 } else {453 } else {
432 root.applicationSelected(LauncherModel.get(index).appId);454 root.applicationSelected(LauncherModel.get(index).appId);
433 }455 }
@@ -481,11 +503,7 @@
481503
482 draggedIndex = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight);504 draggedIndex = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight);
483505
484 // Opening QuickList506 quickList.open(draggedIndex)
485 quickList.item = selectedItem;
486 quickList.model = launcherListView.model.get(draggedIndex).quickList;
487 quickList.appId = launcherListView.model.get(draggedIndex).appId;
488 quickList.state = "open";
489507
490 launcherListView.interactive = false508 launcherListView.interactive = false
491509
@@ -644,7 +662,9 @@
644 enabled: quickList.state == "open" || pressed662 enabled: quickList.state == "open" || pressed
645663
646 onClicked: {664 onClicked: {
647 quickList.state = ""665 quickList.state = "";
666 quickList.focus = false;
667 root.kbdNavigationCancelled();
648 }668 }
649669
650 // Forward for dragging to work when quickList is open670 // Forward for dragging to work when quickList is open
@@ -693,12 +713,60 @@
693 property var model713 property var model
694 property string appId714 property string appId
695 property var item715 property var item
716 property int selectedIndex: -1
717
718 Keys.onPressed: {
719 switch (event.key) {
720 case Qt.Key_Down:
721 selectedIndex++;
722 if (selectedIndex >= popoverRepeater.count) {
723 selectedIndex = 0;
724 }
725 event.accepted = true;
726 break;
727 case Qt.Key_Up:
728 selectedIndex--;
729 if (selectedIndex < 0) {
730 selectedIndex = popoverRepeater.count - 1;
731 }
732 event.accepted = true;
733 break;
734 case Qt.Key_Left:
735 case Qt.Key_Escape:
736 quickList.selectedIndex = -1;
737 quickList.focus = false;
738 quickList.state = ""
739 event.accepted = true;
740 break;
741 case Qt.Key_Enter:
742 case Qt.Key_Return:
743 case Qt.Key_Space:
744 if (quickList.selectedIndex >= 0) {
745 LauncherModel.quickListActionInvoked(quickList.appId, quickList.selectedIndex)
746 }
747 quickList.selectedIndex = -1;
748 quickList.focus = false;
749 quickList.state = ""
750 root.kbdNavigationCancelled();
751 event.accepted = true;
752 break;
753 }
754 }
696755
697 // internal756 // internal
698 property int itemCenter: item ? root.mapFromItem(quickList.item).y + (item.height / 2) + quickList.item.offset : units.gu(1)757 property int itemCenter: item ? root.mapFromItem(quickList.item).y + (item.height / 2) + quickList.item.offset : units.gu(1)
699 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :758 property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height :
700 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0759 itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0
701760
761 function open(index) {
762 var itemPosition = index * launcherListView.itemHeight;
763 var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin
764 item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2);
765 quickList.model = launcherListView.model.get(index).quickList;
766 quickList.appId = launcherListView.model.get(index).appId;
767 quickList.state = "open";
768 }
769
702 Column {770 Column {
703 id: quickListColumn771 id: quickListColumn
704 width: parent.width772 width: parent.width
@@ -712,6 +780,7 @@
712 objectName: "quickListEntry" + index780 objectName: "quickListEntry" + index
713 text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>")781 text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>")
714 highlightWhenPressed: model.clickable782 highlightWhenPressed: model.clickable
783 selected: index === quickList.selectedIndex
715784
716 // FIXME: This is a workaround for the theme not being context sensitive. I.e. the785 // FIXME: This is a workaround for the theme not being context sensitive. I.e. the
717 // ListItems don't know that they are sitting in a themed Popover where the color786 // ListItems don't know that they are sitting in a themed Popover where the color
@@ -727,6 +796,8 @@
727 // Unsetting model to prevent showing changing entries during fading out796 // Unsetting model to prevent showing changing entries during fading out
728 // that may happen because of triggering an action.797 // that may happen because of triggering an action.
729 LauncherModel.quickListActionInvoked(quickList.appId, index);798 LauncherModel.quickListActionInvoked(quickList.appId, index);
799 quickList.focus = false;
800 root.kbdNavigationCancelled();
730 quickList.model = undefined;801 quickList.model = undefined;
731 }802 }
732 }803 }
733804
=== added file 'qml/Launcher/graphics/launcher-app-focus-ring.svg'
--- qml/Launcher/graphics/launcher-app-focus-ring.svg 1970-01-01 00:00:00 +0000
+++ qml/Launcher/graphics/launcher-app-focus-ring.svg 2016-03-10 09:37:58 +0000
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<svg width="172px" height="163px" viewBox="0 0 172 163" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
3 <!-- Generator: Sketch 3.4.4 (17249) - http://www.bohemiancoding.com/sketch -->
4 <title>Shape</title>
5 <desc>Created with Sketch.</desc>
6 <defs></defs>
7 <g id="•-Launcher" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
8 <g id="Artboard-9" sketch:type="MSArtboardGroup" transform="translate(-163.000000, -1436.000000)" fill="#E95420">
9 <path d="M221.983432,1440 L221.983432,1440 C195.6127,1440 184.708233,1442.4723 177.107949,1450.10734 C169.476819,1457.77336 167,1468.79245 167,1495.3481 L167,1538.9019 C167,1565.45755 169.476819,1576.47664 177.107949,1584.14266 C184.708233,1591.7777 195.6127,1594.25 221.983432,1594.25 L276.016868,1594.25 C302.387595,1594.25 313.291998,1591.77771 320.892221,1584.14264 C328.523252,1576.47663 331,1565.45769 331,1538.9019 L331,1495.3481 C331,1468.79231 328.523252,1457.77337 320.892221,1450.10736 C313.291998,1442.47229 302.387595,1440 276.016868,1440 L221.983432,1440 Z M221.983432,1436 L276.016868,1436 C302.345315,1436 314.848953,1438.36655 323.727108,1447.2854 C332.633306,1456.23243 335,1468.85167 335,1495.3481 L335,1538.9019 C335,1565.39833 332.633306,1578.01757 323.727108,1586.9646 C314.848953,1595.88345 302.345315,1598.25 276.016868,1598.25 L221.983432,1598.25 C195.654985,1598.25 183.151291,1595.88345 174.273077,1586.96463 C165.366772,1578.0176 163,1565.39822 163,1538.9019 L163,1495.3481 C163,1468.85178 165.366772,1456.2324 174.273077,1447.28537 C183.151291,1438.36655 195.654985,1436 221.983432,1436 L221.983432,1436 Z" id="Shape" sketch:type="MSShapeGroup"></path>
10 </g>
11 </g>
12</svg>
0\ No newline at end of file13\ No newline at end of file
114
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2016-03-08 20:59:08 +0000
+++ qml/Shell.qml 2016-03-10 09:37:58 +0000
@@ -25,6 +25,7 @@
25import Unity.Connectivity 0.125import Unity.Connectivity 0.1
26import Unity.Launcher 0.126import Unity.Launcher 0.1
27import GlobalShortcut 1.0 // has to be before Utils, because of WindowKeysFilter27import GlobalShortcut 1.0 // has to be before Utils, because of WindowKeysFilter
28import GSettings 1.0
28import Utils 0.129import Utils 0.1
29import Powerd 0.130import Powerd 0.1
30import SessionBroadcast 0.131import SessionBroadcast 0.1
@@ -187,6 +188,11 @@
187 }188 }
188 }189 }
189190
191 GSettings {
192 id: settings
193 schema.id: "com.canonical.Unity8"
194 }
195
190 Item {196 Item {
191 id: stages197 id: stages
192 objectName: "stages"198 objectName: "stages"
@@ -343,6 +349,11 @@
343 property: "altTabPressed"349 property: "altTabPressed"
344 value: physicalKeysMapper.altTabPressed350 value: physicalKeysMapper.altTabPressed
345 }351 }
352 Binding {
353 target: applicationsDisplayLoader.item
354 property: "leftMargin"
355 value: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0
356 }
346 }357 }
347358
348 Tutorial {359 Tutorial {
@@ -373,7 +384,11 @@
373 InputMethod {384 InputMethod {
374 id: inputMethod385 id: inputMethod
375 objectName: "inputMethod"386 objectName: "inputMethod"
376 anchors { fill: parent; topMargin: panel.panelHeight }387 anchors {
388 fill: parent
389 topMargin: panel.panelHeight
390 leftMargin: launcher.lockedVisible ? launcher.panelWidth : 0
391 }
377 z: notifications.useModal || panel.indicators.shown || wizard.active ? overlay.z + 1 : overlay.z - 1392 z: notifications.useModal || panel.indicators.shown || wizard.active ? overlay.z + 1 : overlay.z - 1
378 }393 }
379394
@@ -557,6 +572,10 @@
557 && !greeter.hasLockedApp572 && !greeter.hasLockedApp
558 inverted: shell.usageScenario !== "desktop"573 inverted: shell.usageScenario !== "desktop"
559 shadeBackground: !tutorial.running574 shadeBackground: !tutorial.running
575 superPressed: physicalKeysMapper.superPressed
576 superTabPressed: physicalKeysMapper.superTabPressed
577 panelWidth: units.gu(settings.launcherWidth)
578 lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode
560579
561 onShowDashHome: showHome()580 onShowDashHome: showHome()
562 onDash: showDash()581 onDash: showDash()
@@ -576,6 +595,37 @@
576 panel.indicators.hide()595 panel.indicators.hide()
577 }596 }
578 }597 }
598 onFocusChanged: {
599 if (!focus) {
600 applicationsDisplayLoader.focus = true;
601 }
602 }
603
604 GlobalShortcut {
605 shortcut: Qt.AltModifier | Qt.Key_F1
606 onTriggered: {
607 launcher.openForKeyboardNavigation();
608 }
609 }
610 GlobalShortcut {
611 shortcut: Qt.MetaModifier | Qt.Key_0
612 onTriggered: {
613 if (LauncherModel.get(9)) {
614 activateApplication(LauncherModel.get(9).appId);
615 }
616 }
617 }
618 Repeater {
619 model: 9
620 GlobalShortcut {
621 shortcut: Qt.MetaModifier | (Qt.Key_1 + index)
622 onTriggered: {
623 if (LauncherModel.get(index)) {
624 activateApplication(LauncherModel.get(index).appId);
625 }
626 }
627 }
628 }
579 }629 }
580630
581 Wizard {631 Wizard {
582632
=== modified file 'qml/Stages/AbstractStage.qml'
--- qml/Stages/AbstractStage.qml 2016-01-14 13:03:20 +0000
+++ qml/Stages/AbstractStage.qml 2016-03-10 09:37:58 +0000
@@ -39,6 +39,8 @@
39 property int shellOrientationAngle39 property int shellOrientationAngle
40 property bool spreadEnabled: true // If false, animations and right edge will be disabled40 property bool spreadEnabled: true // If false, animations and right edge will be disabled
41 property bool suspended41 property bool suspended
42 // A Stage should paint a wallpaper etc over its full size but not use the margins for window placement
43 property int leftMargin: 0
4244
43 // To be read from outside45 // To be read from outside
44 property var mainApp: null46 property var mainApp: null
4547
=== modified file 'qml/Stages/DecoratedWindow.qml'
--- qml/Stages/DecoratedWindow.qml 2015-11-30 18:25:47 +0000
+++ qml/Stages/DecoratedWindow.qml 2016-03-10 09:37:58 +0000
@@ -23,8 +23,8 @@
23FocusScope {23FocusScope {
24 id: root24 id: root
2525
26 width: applicationWindow.width26 width: !counterRotate ? applicationWindow.width : applicationWindow.height
27 height: (decorationShown ? decoration.height : 0) + applicationWindow.height27 height: visibleDecorationHeight + (!counterRotate ? applicationWindow.height : applicationWindow.width)
2828
29 property alias window: applicationWindow29 property alias window: applicationWindow
30 property alias application: applicationWindow.application30 property alias application: applicationWindow.application
@@ -36,15 +36,18 @@
36 property bool highlightShown: false36 property bool highlightShown: false
37 property real shadowOpacity: 137 property real shadowOpacity: 1
3838
39 property alias requestedWidth: applicationWindow.requestedWidth39 property real requestedWidth
40 property real requestedHeight40 property real requestedHeight
41 property alias surfaceOrientationAngle: applicationWindow.surfaceOrientationAngle
42 readonly property real visibleDecorationHeight: root.decorationShown ? decoration.height : 0
43 readonly property bool counterRotate: surfaceOrientationAngle != 0 && surfaceOrientationAngle != 180
4144
42 property alias minimumWidth: applicationWindow.minimumWidth45 readonly property int minimumWidth: !counterRotate ? applicationWindow.minimumWidth : applicationWindow.minimumHeight
43 readonly property int minimumHeight: (root.decorationShown ? decoration.height : 0) + applicationWindow.minimumHeight46 readonly property int minimumHeight: visibleDecorationHeight + (!counterRotate ? applicationWindow.minimumHeight : applicationWindow.minimumWidth)
44 property alias maximumWidth: applicationWindow.maximumWidth47 readonly property int maximumWidth: !counterRotate ? applicationWindow.maximumWidth : applicationWindow.maximumHeight
45 readonly property int maximumHeight: (root.decorationShown ? decoration.height : 0) + applicationWindow.maximumHeight48 readonly property int maximumHeight: visibleDecorationHeight + (!counterRotate ? applicationWindow.maximumHeight : applicationWindow.maximumWidth)
46 property alias widthIncrement: applicationWindow.widthIncrement49 readonly property int widthIncrement: !counterRotate ? applicationWindow.widthIncrement : applicationWindow.heightIncrement
47 property alias heightIncrement: applicationWindow.heightIncrement50 readonly property int heightIncrement: !counterRotate ? applicationWindow.heightIncrement : applicationWindow.widthIncrement
4851
49 signal close()52 signal close()
50 signal maximize()53 signal maximize()
@@ -98,8 +101,22 @@
98 anchors.top: parent.top101 anchors.top: parent.top
99 anchors.topMargin: decoration.height102 anchors.topMargin: decoration.height
100 anchors.left: parent.left103 anchors.left: parent.left
101 requestedHeight: root.requestedHeight - (root.decorationShown ? decoration.height : 0)104 readonly property real requestedHeightMinusDecoration: root.requestedHeight - root.visibleDecorationHeight
105 requestedHeight: !counterRotate ? requestedHeightMinusDecoration : root.requestedWidth
106 requestedWidth: !counterRotate ? root.requestedWidth : requestedHeightMinusDecoration
102 interactive: true107 interactive: true
103 focus: true108 focus: true
109
110 transform: Rotation {
111 readonly property int rotationAngle: applicationWindow.application &&
112 applicationWindow.application.rotatesWindowContents
113 ? ((360 - applicationWindow.surfaceOrientationAngle) % 360) : 0
114 readonly property real rotationOrigin: rotationAngle == 90 ? applicationWindow.height / 2
115 : rotationAngle == 270 ? applicationWindow.width / 2
116 : 0
117 origin.x: rotationOrigin
118 origin.y: rotationOrigin
119 angle: rotationAngle
120 }
104 }121 }
105}122}
106123
=== modified file 'qml/Stages/DesktopStage.qml'
--- qml/Stages/DesktopStage.qml 2016-02-03 14:00:47 +0000
+++ qml/Stages/DesktopStage.qml 2016-03-10 09:37:58 +0000
@@ -224,6 +224,7 @@
224 PanelState.dropShadow = false;224 PanelState.dropShadow = false;
225 }225 }
226226
227
227 FocusScope {228 FocusScope {
228 id: appContainer229 id: appContainer
229 objectName: "appContainer"230 objectName: "appContainer"
@@ -254,14 +255,40 @@
254 focus: appId === priv.focusedAppId255 focus: appId === priv.focusedAppId
255 width: decoratedWindow.width256 width: decoratedWindow.width
256 height: decoratedWindow.height257 height: decoratedWindow.height
258
259 Connections {
260 target: root
261 onShellOrientationAngleChanged: {
262 // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle
263 if (application && application.rotatesWindowContents) {
264 if (state == "normal") {
265 var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle;
266 angleDiff = (360 + angleDiff) % 360;
267 if (angleDiff === 90 || angleDiff === 270) {
268 var aux = decoratedWindow.requestedHeight;
269 decoratedWindow.requestedHeight = decoratedWindow.requestedWidth + decoratedWindow.visibleDecorationHeight;
270 decoratedWindow.requestedWidth = aux - decoratedWindow.visibleDecorationHeight;
271 }
272 }
273 decoratedWindow.surfaceOrientationAngle = shellOrientationAngle;
274 } else {
275 decoratedWindow.surfaceOrientationAngle = 0;
276 }
277 }
278 }
279 Component.onCompleted: {
280 decoratedWindow.surfaceOrientationAngle = shellOrientationAngle;
281 }
282
283 readonly property alias application: decoratedWindow.application
284 readonly property alias minimumWidth: decoratedWindow.minimumWidth
285 readonly property alias minimumHeight: decoratedWindow.minimumHeight
286 readonly property alias maximumWidth: decoratedWindow.maximumWidth
287 readonly property alias maximumHeight: decoratedWindow.maximumHeight
288 readonly property alias widthIncrement: decoratedWindow.widthIncrement
289 readonly property alias heightIncrement: decoratedWindow.heightIncrement
257 property alias requestedWidth: decoratedWindow.requestedWidth290 property alias requestedWidth: decoratedWindow.requestedWidth
258 property alias requestedHeight: decoratedWindow.requestedHeight291 property alias requestedHeight: decoratedWindow.requestedHeight
259 property alias minimumWidth: decoratedWindow.minimumWidth
260 property alias minimumHeight: decoratedWindow.minimumHeight
261 property alias maximumWidth: decoratedWindow.maximumWidth
262 property alias maximumHeight: decoratedWindow.maximumHeight
263 property alias widthIncrement: decoratedWindow.widthIncrement
264 property alias heightIncrement: decoratedWindow.heightIncrement
265292
266 QtObject {293 QtObject {
267 id: appDelegatePrivate294 id: appDelegatePrivate
@@ -274,6 +301,7 @@
274 readonly property alias maximizedLeft: appDelegatePrivate.maximizedLeft301 readonly property alias maximizedLeft: appDelegatePrivate.maximizedLeft
275 readonly property alias maximizedRight: appDelegatePrivate.maximizedRight302 readonly property alias maximizedRight: appDelegatePrivate.maximizedRight
276 readonly property alias minimized: appDelegatePrivate.minimized303 readonly property alias minimized: appDelegatePrivate.minimized
304 readonly property alias fullscreen: decoratedWindow.fullscreen
277305
278 readonly property string appId: model.appId306 readonly property string appId: model.appId
279 property bool animationsEnabled: true307 property bool animationsEnabled: true
@@ -293,6 +321,7 @@
293 visible: !visuallyMinimized &&321 visible: !visuallyMinimized &&
294 !greeter.fullyShown &&322 !greeter.fullyShown &&
295 (priv.foregroundMaximizedAppZ === -1 || priv.foregroundMaximizedAppZ <= z) ||323 (priv.foregroundMaximizedAppZ === -1 || priv.foregroundMaximizedAppZ <= z) ||
324 decoratedWindow.fullscreen ||
296 (spread.state == "altTab" && index === spread.highlightedIndex)325 (spread.state == "altTab" && index === spread.highlightedIndex)
297326
298 Binding {327 Binding {
@@ -351,10 +380,11 @@
351 states: [380 states: [
352 State {381 State {
353 name: "fullscreen"; when: decoratedWindow.fullscreen382 name: "fullscreen"; when: decoratedWindow.fullscreen
354 extend: "maximized"
355 PropertyChanges {383 PropertyChanges {
356 target: appDelegate;384 target: appDelegate;
357 y: -PanelState.panelHeight385 x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight)
386 y: rotation == 0 ? -PanelState.panelHeight : (parent.height - height) / 2
387 requestedWidth: appContainer.width; requestedHeight: appContainer.height;
358 }388 }
359 },389 },
360 State {390 State {
@@ -371,21 +401,21 @@
371 name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized401 name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized
372 PropertyChanges {402 PropertyChanges {
373 target: appDelegate;403 target: appDelegate;
374 x: 0; y: 0;404 x: root.leftMargin; y: 0;
375 requestedWidth: root.width; requestedHeight: root.height;405 requestedWidth: appContainer.width - root.leftMargin; requestedHeight: appContainer.height;
376 visuallyMinimized: false;406 visuallyMinimized: false;
377 visuallyMaximized: true407 visuallyMaximized: true
378 }408 }
379 },409 },
380 State {410 State {
381 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized411 name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized
382 PropertyChanges { target: appDelegate; x: 0; y: PanelState.panelHeight;412 PropertyChanges { target: appDelegate; x: root.leftMargin; y: PanelState.panelHeight;
383 requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight }413 requestedWidth: (appContainer.width - root.leftMargin)/2; requestedHeight: appContainer.height - PanelState.panelHeight }
384 },414 },
385 State {415 State {
386 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized416 name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized
387 PropertyChanges { target: appDelegate; x: root.width/2; y: PanelState.panelHeight;417 PropertyChanges { target: appDelegate; x: (appContainer.width + root.leftMargin)/2; y: PanelState.panelHeight;
388 requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight }418 requestedWidth: (appContainer.width - root.leftMargin)/2; requestedHeight: appContainer.height - PanelState.panelHeight }
389 },419 },
390 State {420 State {
391 name: "minimized"; when: appDelegate.minimized421 name: "minimized"; when: appDelegate.minimized
@@ -448,8 +478,9 @@
448 minHeight: units.gu(10)478 minHeight: units.gu(10)
449 borderThickness: units.gu(2)479 borderThickness: units.gu(2)
450 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing480 windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing
451 screenWidth: root.width481 screenWidth: appContainer.width
452 screenHeight: root.height482 screenHeight: appContainer.height
483 leftMargin: root.leftMargin
453484
454 onPressed: { ApplicationManager.focusApplication(model.appId) }485 onPressed: { ApplicationManager.focusApplication(model.appId) }
455 }486 }
@@ -475,7 +506,7 @@
475506
476 BlurLayer {507 BlurLayer {
477 id: blurLayer508 id: blurLayer
478 anchors.fill: parent509 anchors.fill: appContainer
479 source: appContainer510 source: appContainer
480 visible: false511 visible: false
481 }512 }
@@ -527,7 +558,7 @@
527 DesktopSpread {558 DesktopSpread {
528 id: spread559 id: spread
529 objectName: "spread"560 objectName: "spread"
530 anchors.fill: parent561 anchors.fill: appContainer
531 workspace: appContainer562 workspace: appContainer
532 focus: state == "altTab"563 focus: state == "altTab"
533 altTabPressed: root.altTabPressed564 altTabPressed: root.altTabPressed
534565
=== modified file 'qml/Stages/WindowResizeArea.qml'
--- qml/Stages/WindowResizeArea.qml 2016-02-03 14:00:47 +0000
+++ qml/Stages/WindowResizeArea.qml 2016-03-10 09:37:58 +0000
@@ -40,6 +40,7 @@
40 property int defaultHeight: units.gu(50)40 property int defaultHeight: units.gu(50)
41 property int screenWidth: 041 property int screenWidth: 0
42 property int screenHeight: 042 property int screenHeight: 0
43 property int leftMargin: 0
4344
44 QtObject {45 QtObject {
45 id: priv46 id: priv
@@ -72,10 +73,12 @@
72 var windowGeometry = windowStateStorage.getGeometry(root.windowId,73 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
73 Qt.rect(target.x, target.y, defaultWidth, defaultHeight));74 Qt.rect(target.x, target.y, defaultWidth, defaultHeight));
7475
75 target.requestedWidth = Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth);76 target.requestedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
76 target.requestedHeight = Math.min(Math.max(windowGeometry.height, d.minimumHeight), root.screenHeight - PanelState.panelHeight);77 target.requestedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
77 target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - target.requestedWidth), 0)78 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });
78 target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight)79 target.x = Qt.binding(function() { return Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.requestedWidth),
80 (target.fullscreen ? 0 : root.leftMargin)); });
81 target.y = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight); });
7982
80 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)83 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
81 if (windowState === WindowStateStorage.WindowStateMaximized) {84 if (windowState === WindowStateStorage.WindowStateMaximized) {
8285
=== modified file 'tests/mocks/GSettings.1.0/fake_gsettings.cpp'
--- tests/mocks/GSettings.1.0/fake_gsettings.cpp 2015-09-29 20:19:56 +0000
+++ tests/mocks/GSettings.1.0/fake_gsettings.cpp 2016-03-10 09:37:58 +0000
@@ -22,6 +22,8 @@
2222
23GSettingsControllerQml::GSettingsControllerQml()23GSettingsControllerQml::GSettingsControllerQml()
24 : m_usageMode("Staged")24 : m_usageMode("Staged")
25 , m_autohideLauncher(false)
26 , m_launcherWidth(8)
25{27{
26}28}
2729
@@ -88,6 +90,32 @@
88 }90 }
89}91}
9092
93bool GSettingsControllerQml::autohideLauncher() const
94{
95 return m_autohideLauncher;
96}
97
98void GSettingsControllerQml::setAutohideLauncher(bool autohideLauncher)
99{
100 if (m_autohideLauncher != autohideLauncher) {
101 m_autohideLauncher = autohideLauncher;
102 Q_EMIT autohideLauncherChanged(autohideLauncher);
103 }
104}
105
106int GSettingsControllerQml::launcherWidth() const
107{
108 return m_launcherWidth;
109}
110
111void GSettingsControllerQml::setLauncherWidth(int launcherWidth)
112{
113 if (m_launcherWidth != launcherWidth) {
114 m_launcherWidth = launcherWidth;
115 Q_EMIT launcherWidthChanged(launcherWidth);
116 }
117}
118
91GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {119GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
92}120}
93121
@@ -129,6 +157,10 @@
129 this, &GSettingsQml::lockedOutTimeChanged);157 this, &GSettingsQml::lockedOutTimeChanged);
130 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::lifecycleExemptAppidsChanged,158 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::lifecycleExemptAppidsChanged,
131 this, &GSettingsQml::lifecycleExemptAppidsChanged);159 this, &GSettingsQml::lifecycleExemptAppidsChanged);
160 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::autohideLauncherChanged,
161 this, &GSettingsQml::autohideLauncherChanged);
162 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::launcherWidthChanged,
163 this, &GSettingsQml::launcherWidthChanged);
132}164}
133165
134GSettingsSchemaQml * GSettingsQml::schema() const {166GSettingsSchemaQml * GSettingsQml::schema() const {
@@ -192,9 +224,41 @@
192 }224 }
193}225}
194226
227bool GSettingsQml::autohideLauncher() const
228{
229 if (m_schema->id() == "com.canonical.Unity8") {
230 return GSettingsControllerQml::instance()->autohideLauncher();
231 } else {
232 return false;
233 }
234}
235
236int GSettingsQml::launcherWidth() const
237{
238 if (m_schema->id() == "com.canonical.Unity8") {
239 return GSettingsControllerQml::instance()->launcherWidth();
240 } else {
241 return false;
242 }
243}
244
195void GSettingsQml::setLifecycleExemptAppids(const QStringList &appIds)245void GSettingsQml::setLifecycleExemptAppids(const QStringList &appIds)
196{246{
197 if (m_schema->id() == "com.canonical.qtmir") {247 if (m_schema->id() == "com.canonical.qtmir") {
198 GSettingsControllerQml::instance()->setLifecycleExemptAppids(appIds);248 GSettingsControllerQml::instance()->setLifecycleExemptAppids(appIds);
199 }249 }
200}250}
251
252void GSettingsQml::setAutohideLauncher(bool autohideLauncher)
253{
254 if (m_schema->id() == "com.canonical.Unity8") {
255 GSettingsControllerQml::instance()->setAutohideLauncher(autohideLauncher);
256 }
257}
258
259void GSettingsQml::setLauncherWidth(int launcherWidth)
260{
261 if (m_schema->id() == "com.canonical.Unity8") {
262 GSettingsControllerQml::instance()->setLauncherWidth(launcherWidth);
263 }
264}
201265
=== modified file 'tests/mocks/GSettings.1.0/fake_gsettings.h'
--- tests/mocks/GSettings.1.0/fake_gsettings.h 2015-09-29 20:19:56 +0000
+++ tests/mocks/GSettings.1.0/fake_gsettings.h 2016-03-10 09:37:58 +0000
@@ -50,6 +50,8 @@
50 Q_PROPERTY(QString usageMode READ usageMode WRITE setUsageMode NOTIFY usageModeChanged)50 Q_PROPERTY(QString usageMode READ usageMode WRITE setUsageMode NOTIFY usageModeChanged)
51 Q_PROPERTY(qint64 lockedOutTime READ lockedOutTime WRITE setLockedOutTime NOTIFY lockedOutTimeChanged)51 Q_PROPERTY(qint64 lockedOutTime READ lockedOutTime WRITE setLockedOutTime NOTIFY lockedOutTimeChanged)
52 Q_PROPERTY(QStringList lifecycleExemptAppids READ lifecycleExemptAppids WRITE setLifecycleExemptAppids NOTIFY lifecycleExemptAppidsChanged)52 Q_PROPERTY(QStringList lifecycleExemptAppids READ lifecycleExemptAppids WRITE setLifecycleExemptAppids NOTIFY lifecycleExemptAppidsChanged)
53 Q_PROPERTY(bool autohideLauncher READ autohideLauncher WRITE setAutohideLauncher NOTIFY autohideLauncherChanged)
54 Q_PROPERTY(int launcherWidth READ launcherWidth WRITE setLauncherWidth NOTIFY launcherWidthChanged)
5355
54public:56public:
55 GSettingsQml(QObject *parent = nullptr);57 GSettingsQml(QObject *parent = nullptr);
@@ -59,11 +61,15 @@
59 QString usageMode() const;61 QString usageMode() const;
60 qint64 lockedOutTime() const;62 qint64 lockedOutTime() const;
61 QStringList lifecycleExemptAppids() const;63 QStringList lifecycleExemptAppids() const;
64 bool autohideLauncher() const;
65 int launcherWidth() const;
6266
63 void setPictureUri(const QString &str);67 void setPictureUri(const QString &str);
64 void setUsageMode(const QString &usageMode);68 void setUsageMode(const QString &usageMode);
65 void setLockedOutTime(qint64 timestamp);69 void setLockedOutTime(qint64 timestamp);
66 void setLifecycleExemptAppids(const QStringList &appIds);70 void setLifecycleExemptAppids(const QStringList &appIds);
71 void setAutohideLauncher(bool autohideLauncher);
72 void setLauncherWidth(int launcherWidth);
6773
68Q_SIGNALS:74Q_SIGNALS:
69 void schemaChanged();75 void schemaChanged();
@@ -71,6 +77,8 @@
71 void usageModeChanged(const QString&);77 void usageModeChanged(const QString&);
72 void lockedOutTimeChanged(qint64);78 void lockedOutTimeChanged(qint64);
73 void lifecycleExemptAppidsChanged(const QStringList &);79 void lifecycleExemptAppidsChanged(const QStringList &);
80 void autohideLauncherChanged(bool);
81 void launcherWidthChanged(int launcherWidth);
7482
75private:83private:
76 GSettingsSchemaQml* m_schema;84 GSettingsSchemaQml* m_schema;
@@ -98,11 +106,19 @@
98 QStringList lifecycleExemptAppids() const;106 QStringList lifecycleExemptAppids() const;
99 Q_INVOKABLE void setLifecycleExemptAppids(const QStringList &appIds);107 Q_INVOKABLE void setLifecycleExemptAppids(const QStringList &appIds);
100108
109 bool autohideLauncher() const;
110 Q_INVOKABLE void setAutohideLauncher(bool autohideLauncher);
111
112 int launcherWidth() const;
113 Q_INVOKABLE void setLauncherWidth(int launcherWidth);
114
101Q_SIGNALS:115Q_SIGNALS:
102 void pictureUriChanged(const QString&);116 void pictureUriChanged(const QString&);
103 void usageModeChanged(const QString&);117 void usageModeChanged(const QString&);
104 void lockedOutTimeChanged(qint64 timestamp);118 void lockedOutTimeChanged(qint64 timestamp);
105 void lifecycleExemptAppidsChanged(const QStringList&);119 void lifecycleExemptAppidsChanged(const QStringList&);
120 void autohideLauncherChanged(bool autohideLauncher);
121 void launcherWidthChanged(int launcherWidth);
106122
107private:123private:
108 GSettingsControllerQml();124 GSettingsControllerQml();
@@ -111,6 +127,8 @@
111 QString m_usageMode;127 QString m_usageMode;
112 qint64 m_lockedOutTime;128 qint64 m_lockedOutTime;
113 QStringList m_lifecycleExemptAppids;129 QStringList m_lifecycleExemptAppids;
130 bool m_autohideLauncher;
131 int m_launcherWidth;
114132
115 static GSettingsControllerQml* s_controllerInstance;133 static GSettingsControllerQml* s_controllerInstance;
116 QList<GSettingsQml *> m_registeredGSettings;134 QList<GSettingsQml *> m_registeredGSettings;
117135
=== modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp'
--- tests/mocks/Unity/Application/ApplicationManager.cpp 2015-12-03 18:10:39 +0000
+++ tests/mocks/Unity/Application/ApplicationManager.cpp 2016-03-10 09:37:58 +0000
@@ -345,6 +345,18 @@
345 m_availableApplications.append(application);345 m_availableApplications.append(application);
346346
347 application = new ApplicationInfo(this);347 application = new ApplicationInfo(this);
348 application->setAppId("camera-app2");
349 application->setName("Camera2");
350 application->setScreenshotId("camera");
351 application->setIconId("camera");
352 application->setSupportedOrientations(Qt::PortraitOrientation
353 | Qt::LandscapeOrientation
354 | Qt::InvertedPortraitOrientation
355 | Qt::InvertedLandscapeOrientation);
356 application->setRotatesWindowContents(true);
357 m_availableApplications.append(application);
358
359 application = new ApplicationInfo(this);
348 application->setAppId("gallery-app");360 application->setAppId("gallery-app");
349 application->setName("Gallery");361 application->setName("Gallery");
350 application->setScreenshotId("gallery");362 application->setScreenshotId("gallery");
351363
=== modified file 'tests/mocks/Unity/Launcher/MockLauncherModel.cpp'
--- tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2015-11-04 11:29:16 +0000
+++ tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2016-03-10 09:37:58 +0000
@@ -25,15 +25,20 @@
25 MockLauncherItem *item = new MockLauncherItem("dialer-app", "/usr/share/applications/dialer-app.desktop", "Dialer", "dialer-app", this);25 MockLauncherItem *item = new MockLauncherItem("dialer-app", "/usr/share/applications/dialer-app.desktop", "Dialer", "dialer-app", this);
26 item->setProgress(0);26 item->setProgress(0);
27 item->setPinned(true);27 item->setPinned(true);
28 item->setRunning(true);
28 item->setFocused(true);29 item->setFocused(true);
29 m_list.append(item);30 m_list.append(item);
30 item = new MockLauncherItem("camera-app", "/usr/share/applications/camera-app.desktop", "Camera", "camera", this);31 item = new MockLauncherItem("camera-app", "/usr/share/applications/camera-app.desktop", "Camera", "camera", this);
31 item->setProgress(10);32 item->setProgress(10);
32 item->setPinned(true);33 item->setPinned(true);
33 m_list.append(item);34 m_list.append(item);
35 item = new MockLauncherItem("camera-app2", "/usr/share/applications/camera-app2.desktop", "Camera2", "camera", this);
36 item->setPinned(true);
37 m_list.append(item);
34 item = new MockLauncherItem("gallery-app", "/usr/share/applications/gallery-app.desktop", "Gallery", "gallery", this);38 item = new MockLauncherItem("gallery-app", "/usr/share/applications/gallery-app.desktop", "Gallery", "gallery", this);
35 item->setProgress(50);39 item->setProgress(50);
36 item->setCountVisible(true);40 item->setCountVisible(true);
41 item->setRunning(true);
37 item->setAlerting(false);42 item->setAlerting(false);
38 m_list.append(item);43 m_list.append(item);
39 item = new MockLauncherItem("music-app", "/usr/share/applications/music-app.desktop", "Music", "soundcloud", this);44 item = new MockLauncherItem("music-app", "/usr/share/applications/music-app.desktop", "Music", "soundcloud", this);
4045
=== modified file 'tests/qmltests/Launcher/tst_Launcher.qml'
--- tests/qmltests/Launcher/tst_Launcher.qml 2016-01-19 15:36:15 +0000
+++ tests/qmltests/Launcher/tst_Launcher.qml 2016-03-10 09:37:58 +0000
@@ -28,12 +28,13 @@
28 launcher. */28 launcher. */
29Item {29Item {
30 id: root30 id: root
31 width: units.gu(50)31 width: units.gu(140)
32 height: units.gu(55)32 height: units.gu(70)
3333
34 Loader {34 Loader {
35 id: launcherLoader35 id: launcherLoader
36 anchors.fill: parent36 anchors.fill: parent
37 focus: true
37 property bool itemDestroyed: false38 property bool itemDestroyed: false
38 sourceComponent: Component {39 sourceComponent: Component {
39 Launcher {40 Launcher {
@@ -68,6 +69,7 @@
6869
69 Component.onCompleted: {70 Component.onCompleted: {
70 launcherLoader.itemDestroyed = false;71 launcherLoader.itemDestroyed = false;
72 launcherLoader.focus = true
71 edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController");73 edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController");
72 }74 }
73 Component.onDestruction: {75 Component.onDestruction: {
@@ -77,11 +79,40 @@
77 }79 }
78 }80 }
7981
82 Binding {
83 target: launcherLoader.item
84 property: "lockedVisible"
85 value: lockedVisibleCheckBox.checked
86 }
87 Binding {
88 target: launcherLoader.item
89 property: "panelWidth"
90 value: units.gu(Math.round(widthSlider.value))
91 }
92
80 ColumnLayout {93 ColumnLayout {
81 anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) }94 anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) }
82 spacing: units.gu(1)95 spacing: units.gu(1)
83 width: childrenRect.width96 width: childrenRect.width
8497
98 RowLayout {
99 CheckBox {
100 id: lockedVisibleCheckBox
101 checked: false
102 }
103 Label {
104 text: "Launcher always visible"
105 }
106 }
107
108 Slider {
109 id: widthSlider
110 Layout.fillWidth: true
111 minimumValue: 6
112 maximumValue: 12
113 value: 10
114 }
115
85 MouseTouchEmulationCheckbox {}116 MouseTouchEmulationCheckbox {}
86117
87 EdgeBarrierControls {118 EdgeBarrierControls {
@@ -102,6 +133,15 @@
102 Layout.fillWidth: true133 Layout.fillWidth: true
103 }134 }
104135
136 Button {
137 text: "open for kbd navigation"
138 onClicked: {
139 launcherLoader.item.openForKeyboardNavigation()
140 launcherLoader.item.forceActiveFocus();// = true
141 }
142 Layout.fillWidth: true
143 }
144
105 Row {145 Row {
106 spacing: units.gu(1)146 spacing: units.gu(1)
107147
@@ -206,10 +246,6 @@
206 // growing while populating it with icons etc.246 // growing while populating it with icons etc.
207 tryCompare(listView, "flicking", false);247 tryCompare(listView, "flicking", false);
208248
209 // Make sure noone changed the height of the window. The issue this test case
210 // is verifying only happens on certain heights of the Launcher
211 compare(root.height, units.gu(55));
212
213 compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded");249 compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded");
214250
215 // Now do check that snapping is in fact enabled251 // Now do check that snapping is in fact enabled
@@ -266,13 +302,32 @@
266302
267 function positionLauncherListAtBeginning() {303 function positionLauncherListAtBeginning() {
268 var listView = testCase.findChild(launcherLoader.item, "launcherListView");304 var listView = testCase.findChild(launcherLoader.item, "launcherListView");
269 listView.contentY = -listView.topMargin;305 var moveAnimation = findInvisibleChild(listView, "moveAnimation")
306
307 listView.moveToIndex(0);
308
309 waitForRendering(listView);
310 tryCompare(moveAnimation, "running", false);
270 }311 }
271 function positionLauncherListAtEnd() {312 function positionLauncherListAtEnd() {
272 var listView = testCase.findChild(launcherLoader.item, "launcherListView");313 var listView = testCase.findChild(launcherLoader.item, "launcherListView");
273 if ((listView.contentHeight + listView.topMargin + listView.bottomMargin) > listView.height) {314 var moveAnimation = findInvisibleChild(listView, "moveAnimation")
274 listView.contentY = listView.topMargin + listView.contentHeight315
275 - listView.height;316 listView.moveToIndex(listView.count -1);
317
318 waitForRendering(listView);
319 tryCompare(moveAnimation, "running", false);
320 }
321
322 function assertFocusOnIndex(index) {
323 var launcherListView = findChild(launcher, "launcherListView");
324 var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
325
326 waitForRendering(launcher);
327 compare(bfbFocusHighlight.visible, index === -1);
328 for (var i = 0; i < launcherListView.count; i++) {
329 var focusRing = findChild(findChild(launcher, "launcherDelegate" + i), "focusRing")
330 compare(focusRing.visible, index === i);
276 }331 }
277 }332 }
278333
@@ -290,10 +345,10 @@
290 dragLauncherIntoView()345 dragLauncherIntoView()
291346
292 // tapping on the center of the screen should dismiss the launcher347 // tapping on the center of the screen should dismiss the launcher
293 mouseClick(launcher)348 mouseClick(launcher, panel.width + units.gu(5), launcher.height / 2)
294349
295 // should eventually get fully retracted (hidden)350 // should eventually get fully retracted (hidden)
296 tryCompare(panel, "x", -launcher.panelWidth, 1000)351 tryCompare(panel, "x", -launcher.panelWidth, 2000)
297 }352 }
298353
299 /* If I click on the icon of an application on the launcher354 /* If I click on the icon of an application on the launcher
@@ -377,6 +432,7 @@
377 wait(100)432 wait(100)
378 compare(launcher.maxPanelX, -launcher.panelWidth, "Launcher moved even if it shouldn't")433 compare(launcher.maxPanelX, -launcher.panelWidth, "Launcher moved even if it shouldn't")
379 }434 }
435
380 waitUntilLauncherDisappears();436 waitUntilLauncherDisappears();
381 launcher.available = true;437 launcher.available = true;
382 }438 }
@@ -400,6 +456,8 @@
400 dragLauncherIntoView();456 dragLauncherIntoView();
401 var launcherListView = findChild(launcher, "launcherListView");457 var launcherListView = findChild(launcher, "launcherListView");
402 for (var i = 0; i < launcherListView.count; ++i) {458 for (var i = 0; i < launcherListView.count; ++i) {
459 launcherListView.moveToIndex(i);
460 waitForRendering(launcherListView);
403 var delegate = findChild(launcherListView, "launcherDelegate" + i)461 var delegate = findChild(launcherListView, "launcherDelegate" + i)
404 compare(findChild(delegate, "countEmblem").visible, LauncherModel.get(i).countVisible)462 compare(findChild(delegate, "countEmblem").visible, LauncherModel.get(i).countVisible)
405 // Intentionally allow type coercion (string/number)463 // Intentionally allow type coercion (string/number)
@@ -421,7 +479,7 @@
421 var launcherListView = findChild(launcher, "launcherListView");479 var launcherListView = findChild(launcher, "launcherListView");
422 for (var i = 0; i < launcherListView.count; ++i) {480 for (var i = 0; i < launcherListView.count; ++i) {
423 var delegate = findChild(launcherListView, "launcherDelegate" + i)481 var delegate = findChild(launcherListView, "launcherDelegate" + i)
424 compare(findChild(delegate, "runningHighlight").visible, LauncherModel.get(i).running)482 compare(findChild(delegate, "runningHighlight0").visible, LauncherModel.get(i).running)
425 }483 }
426 }484 }
427485
@@ -460,6 +518,7 @@
460 launcher.lastSelectedApplication = "";518 launcher.lastSelectedApplication = "";
461 dragLauncherIntoView();519 dragLauncherIntoView();
462 var listView = findChild(launcher, "launcherListView");520 var listView = findChild(launcher, "launcherListView");
521 var moveAnimation = findInvisibleChild(listView, "moveAnimation")
463522
464 // flicking is unreliable. sometimes it works, sometimes the523 // flicking is unreliable. sometimes it works, sometimes the
465 // list view moves just a tiny bit or not at all, making tests fail.524 // list view moves just a tiny bit or not at all, making tests fail.
@@ -470,12 +529,14 @@
470 } else {529 } else {
471 positionLauncherListAtEnd();530 positionLauncherListAtEnd();
472 }531 }
473 tryCompare(listView, "flicking", false);
474
475 var oldY = listView.contentY;532 var oldY = listView.contentY;
476533
477 mouseClick(listView, listView.width / 2, data.clickY);534 mouseClick(listView, listView.width / 2, data.clickY);
478 tryCompare(listView, "flicking", false);535
536 if (data.expectFlick) {
537 tryCompare(moveAnimation, "running", true);
538 }
539 tryCompare(moveAnimation, "running", false);
479540
480 if (data.expectFlick) {541 if (data.expectFlick) {
481 verify(listView.contentY != oldY);542 verify(listView.contentY != oldY);
@@ -764,14 +825,15 @@
764 function test_launcher_dismiss() {825 function test_launcher_dismiss() {
765 dragLauncherIntoView();826 dragLauncherIntoView();
766 verify(launcher.state == "visible");827 verify(launcher.state == "visible");
767 mouseClick(root);828
829 mouseClick(root, root.width / 2, units.gu(1));
768 waitUntilLauncherDisappears();830 waitUntilLauncherDisappears();
769 verify(launcher.state == "");831 verify(launcher.state == "");
770832
771 // and repeat, as a test for regression in lpbug#1531339833 // and repeat, as a test for regression in lpbug#1531339
772 dragLauncherIntoView();834 dragLauncherIntoView();
773 verify(launcher.state == "visible");835 verify(launcher.state == "visible");
774 mouseClick(root);836 mouseClick(root, root.width / 2, units.gu(1));
775 waitUntilLauncherDisappears();837 waitUntilLauncherDisappears();
776 verify(launcher.state == "");838 verify(launcher.state == "");
777 }839 }
@@ -1044,5 +1106,169 @@
1044 LauncherModel.setCountVisible(LauncherModel.get(1).appId, 0)1106 LauncherModel.setCountVisible(LauncherModel.get(1).appId, 0)
1045 LauncherModel.setCount(LauncherModel.get(1).appId, oldCount)1107 LauncherModel.setCount(LauncherModel.get(1).appId, oldCount)
1046 }1108 }
1109
1110 function test_longpressSuperKeyShowsHints() {
1111 var shortCutHint0 = findChild(findChild(launcher, "launcherDelegate0"), "shortcutHint");
1112
1113 tryCompare(shortCutHint0, "visible", false);
1114
1115 launcher.superPressed = true;
1116 tryCompare(launcher, "state", "visible");
1117 tryCompare(shortCutHint0, "visible", true);
1118
1119 launcher.superPressed = false;
1120 tryCompare(launcher, "state", "");
1121 tryCompare(shortCutHint0, "visible", false);
1122 }
1123
1124 function test_keyboardNavigation() {
1125 var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight");
1126 var quickList = findChild(launcher, "quickList");
1127 var launcherPanel = findChild(launcher, "launcherPanel");
1128 var launcherListView = findChild(launcher, "launcherListView");
1129 var last = launcherListView.count - 1;
1130
1131 compare(bfbFocusHighlight.visible, false);
1132
1133 launcher.openForKeyboardNavigation();
1134 tryCompare(launcherPanel, "x", 0);
1135 waitForRendering(launcher);
1136
1137 assertFocusOnIndex(-1);
1138
1139 // Down should go down
1140 keyClick(Qt.Key_Down);
1141 assertFocusOnIndex(0);
1142
1143 // Tab should go down
1144 keyClick(Qt.Key_Tab);
1145 assertFocusOnIndex(1);
1146
1147 // Up should go up
1148 keyClick(Qt.Key_Up);
1149 assertFocusOnIndex(0);
1150
1151 // Backtab should go up
1152 keyClick(Qt.Key_Backtab);
1153 assertFocusOnIndex(-1); // BFB
1154
1155 // The list should wrap around
1156 keyClick(Qt.Key_Up);
1157 assertFocusOnIndex(last);
1158
1159 keyClick(Qt.Key_Down);
1160 waitForRendering(launcher);
1161 keyClick(Qt.Key_Down);
1162 assertFocusOnIndex(0); // Back to Top
1163
1164 // Right opens the quicklist
1165 keyClick(Qt.Key_Right);
1166 assertFocusOnIndex(0); // Navigating the quicklist... the launcher focus should not move
1167 tryCompare(quickList, "visible", true);
1168 tryCompare(quickList, "selectedIndex", 0)
1169
1170 // Down should move down the quicklist
1171 keyClick(Qt.Key_Down);
1172 tryCompare(quickList, "selectedIndex", 1)
1173
1174 // The quicklist should wrap around too
1175 keyClick(Qt.Key_Down);
1176 keyClick(Qt.Key_Down);
1177 keyClick(Qt.Key_Down);
1178 tryCompare(quickList, "selectedIndex", 0)
1179
1180 // Left gets us back to the launcher
1181 keyClick(Qt.Key_Left);
1182 assertFocusOnIndex(0);
1183 tryCompare(quickList, "visible", false);
1184
1185 // Launcher navigation should still work
1186 // Go bar to top by wrapping around
1187 keyClick(Qt.Key_Down);
1188 assertFocusOnIndex(1);
1189 }
1190
1191 function test_selectQuicklistItemByKeyboard() {
1192 launcher.openForKeyboardNavigation();
1193 waitForRendering(launcher);
1194
1195 signalSpy.clear();
1196 signalSpy.signalName = "quickListTriggered"
1197
1198 keyClick(Qt.Key_Down); // Down to launcher item 0
1199 keyClick(Qt.Key_Down); // Down to launcher item 1
1200 keyClick(Qt.Key_Right); // Into quicklist
1201 keyClick(Qt.Key_Down); // Down to quicklist item 1
1202 keyClick(Qt.Key_Down); // Down to quicklist item 2
1203 keyClick(Qt.Key_Enter); // Trigger it
1204
1205 compare(signalSpy.count, 1, "Quicklist signal wasn't triggered")
1206 compare(signalSpy.signalArguments[0][0], LauncherModel.get(1).appId)
1207 compare(signalSpy.signalArguments[0][1], 2)
1208 assertFocusOnIndex(-2);
1209 }
1210
1211 function test_hideNotWorkingWhenLockedOut_data() {
1212 return [
1213 {tag: "locked visible", locked: true},
1214 {tag: "no locked visible", locked: false},
1215 ]
1216 }
1217
1218 function test_hideNotWorkingWhenLockedOut(data) {
1219 launcher.lockedVisible = data.locked;
1220 if (data.locked) {
1221 tryCompare(launcher, "state", "visible");
1222 } else {
1223 tryCompare(launcher, "state", "");
1224 }
1225
1226 launcher.hide();
1227 waitForRendering(launcher);
1228 if (data.locked) {
1229 verify(launcher.state == "visible");
1230 } else {
1231 verify(launcher.state == "");
1232 }
1233 }
1234
1235 function test_cancelKbdNavigationWitMouse_data() {
1236 return [
1237 {tag: "locked out - no quicklist", autohide: false, withQuickList: false },
1238 {tag: "locked out - with quicklist", autohide: false, withQuickList: true },
1239 {tag: "autohide - no quicklist", autohide: true, withQuickList: false },
1240 {tag: "autohide - with quicklist", autohide: true, withQuickList: true },
1241 ]
1242 }
1243
1244 function test_cancelKbdNavigationWitMouse(data) {
1245 launcher.autohideEnabled = data.autohide;
1246 launcher.openForKeyboardNavigation();
1247 waitForRendering(launcher);
1248
1249 var launcherPanel = findChild(launcher, "launcherPanel");
1250 tryCompare(launcherPanel, "x", 0);
1251
1252 var quickList = findChild(launcher, "quickList");
1253
1254 keyClick(Qt.Key_Down); // Down to launcher item 0
1255 keyClick(Qt.Key_Down); // Down to launcher item 1
1256
1257 if (data.withQuickList) {
1258 keyClick(Qt.Key_Right); // Into quicklist
1259 tryCompare(quickList, "visible", true)
1260 }
1261 waitForRendering(launcher)
1262
1263 mouseClick(root);
1264
1265 if (data.autohide) {
1266 tryCompare(launcher, "state", "");
1267 } else {
1268 tryCompare(launcher, "state", "visible");
1269 }
1270
1271 assertFocusOnIndex(-2);
1272 }
1047 }1273 }
1048}1274}
10491275
=== modified file 'tests/qmltests/tst_OrientedShell.qml'
--- tests/qmltests/tst_OrientedShell.qml 2016-01-28 11:31:48 +0000
+++ tests/qmltests/tst_OrientedShell.qml 2016-03-10 09:37:58 +0000
@@ -26,6 +26,7 @@
26import Unity.InputInfo 0.126import Unity.InputInfo 0.1
2727
28import "../../qml"28import "../../qml"
29import "Stages"
2930
30Rectangle {31Rectangle {
31 id: root32 id: root
@@ -406,6 +407,8 @@
406 }407 }
407 }408 }
408 }409 }
410
411 SurfaceManagerControls { textColor: "white" }
409 }412 }
410 }413 }
411414
@@ -551,8 +554,11 @@
551 function test_appRotatesWindowContents_data() {554 function test_appRotatesWindowContents_data() {
552 return [555 return [
553 {tag: "mako", deviceName: "mako", orientationAngleAfterRotation: 90},556 {tag: "mako", deviceName: "mako", orientationAngleAfterRotation: 90},
557 {tag: "mako_windowed", deviceName: "mako", orientationAngleAfterRotation: 90, windowed: true},
554 {tag: "manta", deviceName: "manta", orientationAngleAfterRotation: 90},558 {tag: "manta", deviceName: "manta", orientationAngleAfterRotation: 90},
555 {tag: "flo", deviceName: "flo", orientationAngleAfterRotation: 180}559 {tag: "manta_windowed", deviceName: "manta", orientationAngleAfterRotation: 90, windowed: true},
560 {tag: "flo", deviceName: "flo", orientationAngleAfterRotation: 180},
561 {tag: "flo_windowed", deviceName: "flo", orientationAngleAfterRotation: 180, windowed: true}
556 ];562 ];
557 }563 }
558 function test_appRotatesWindowContents(data) {564 function test_appRotatesWindowContents(data) {
@@ -560,6 +566,12 @@
560 var cameraApp = ApplicationManager.startApplication("camera-app");566 var cameraApp = ApplicationManager.startApplication("camera-app");
561 verify(cameraApp);567 verify(cameraApp);
562568
569 if (data.windowed) {
570 usageModeSelector.selectWindowed();
571 } else {
572 usageModeSelector.selectStaged();
573 }
574
563 // ensure the mock camera-app is as we expect575 // ensure the mock camera-app is as we expect
564 compare(cameraApp.fullscreen, true);576 compare(cameraApp.fullscreen, true);
565 compare(cameraApp.rotatesWindowContents, true);577 compare(cameraApp.rotatesWindowContents, true);
566578
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2016-02-12 00:11:28 +0000
+++ tests/qmltests/tst_Shell.qml 2016-03-10 09:37:58 +0000
@@ -26,6 +26,7 @@
26import Unity.Connectivity 0.126import Unity.Connectivity 0.1
27import Unity.Indicators 0.127import Unity.Indicators 0.1
28import Unity.Notifications 1.028import Unity.Notifications 1.0
29import Unity.Launcher 0.1
29import Unity.Test 0.130import Unity.Test 0.1
30import Powerd 0.131import Powerd 0.1
31import Wizard 0.1 as Wizard32import Wizard 0.1 as Wizard
@@ -121,10 +122,6 @@
121 Component.onDestruction: {122 Component.onDestruction: {
122 shellLoader.itemDestroyed = true;123 shellLoader.itemDestroyed = true;
123 }124 }
124 Component.onCompleted: {
125 var keyMapper = testCase.findChild(__shell, "physicalKeysMapper");
126 keyMapper.controlInsteadOfAlt = true;
127 }
128 }125 }
129 }126 }
130 }127 }
@@ -213,6 +210,31 @@
213 checked: true210 checked: true
214 color: "white"211 color: "white"
215 }212 }
213 ListItem.ItemSelector {
214 id: ctrlModifier
215 anchors { left: parent.left; right: parent.right }
216 activeFocusOnPress: false
217 text: "Ctrl key as"
218 model: ["Ctrl", "Alt", "Super"]
219 onSelectedIndexChanged: {
220 var keyMapper = testCase.findChild(shellContainer, "physicalKeysMapper");
221 keyMapper.controlInsteadOfAlt = selectedIndex == 1;
222 keyMapper.controlInsteadOfSuper = selectedIndex == 2;
223 }
224 }
225
226 Row {
227 anchors { left: parent.left; right: parent.right }
228 CheckBox {
229 id: autohideLauncherCheckbox
230 onCheckedChanged: {
231 GSettingsController.setAutohideLauncher(checked)
232 }
233 }
234 Label {
235 text: "Autohide launcher"
236 }
237 }
216238
217 Label { text: "Applications"; font.bold: true }239 Label { text: "Applications"; font.bold: true }
218240
@@ -912,6 +934,7 @@
912 function dragLauncherIntoView() {934 function dragLauncherIntoView() {
913 var launcher = findChild(shell, "launcher");935 var launcher = findChild(shell, "launcher");
914 var launcherPanel = findChild(launcher, "launcherPanel");936 var launcherPanel = findChild(launcher, "launcherPanel");
937 waitForRendering(launcher);
915 verify(launcherPanel.x = - launcherPanel.width);938 verify(launcherPanel.x = - launcherPanel.width);
916939
917 var touchStartX = 2;940 var touchStartX = 2;
@@ -1441,7 +1464,7 @@
14411464
1442 // Do a quick alt-tab and see if focus changes1465 // Do a quick alt-tab and see if focus changes
1443 tryCompare(app3.session.lastSurface, "activeFocus", true)1466 tryCompare(app3.session.lastSurface, "activeFocus", true)
1444 keyClick(Qt.Key_Tab, Qt.ControlModifier)1467 keyClick(Qt.Key_Tab, Qt.AltModifier)
1445 tryCompare(app2.session.lastSurface, "activeFocus", true)1468 tryCompare(app2.session.lastSurface, "activeFocus", true)
14461469
1447 var desktopSpread = findChild(shell, "spread")1470 var desktopSpread = findChild(shell, "spread")
@@ -1449,12 +1472,12 @@
1449 tryCompare(desktopSpread, "state", "")1472 tryCompare(desktopSpread, "state", "")
14501473
1451 // Just press Alt, make sure the spread comes up1474 // Just press Alt, make sure the spread comes up
1452 keyPress(Qt.Key_Control);1475 keyPress(Qt.Key_Alt);
1453 keyClick(Qt.Key_Tab);1476 keyClick(Qt.Key_Tab);
1454 tryCompare(desktopSpread, "state", "altTab")1477 tryCompare(desktopSpread, "state", "altTab")
14551478
1456 // Release control, check if spread disappears1479 // Release control, check if spread disappears
1457 keyRelease(Qt.Key_Control)1480 keyRelease(Qt.Key_Alt)
1458 tryCompare(desktopSpread, "state", "")1481 tryCompare(desktopSpread, "state", "")
14591482
1460 // Focus should have switched back now1483 // Focus should have switched back now
@@ -1482,7 +1505,7 @@
1482 tryCompare(desktopSpread, "state", "")1505 tryCompare(desktopSpread, "state", "")
14831506
1484 // Just press Alt, make sure the spread comes up1507 // Just press Alt, make sure the spread comes up
1485 keyPress(Qt.Key_Control);1508 keyPress(Qt.Key_Alt);
1486 keyClick(Qt.Key_Tab);1509 keyClick(Qt.Key_Tab);
1487 tryCompare(desktopSpread, "state", "altTab")1510 tryCompare(desktopSpread, "state", "altTab")
1488 tryCompare(spreadRepeater, "highlightedIndex", 1)1511 tryCompare(spreadRepeater, "highlightedIndex", 1)
@@ -1503,7 +1526,7 @@
1503 tryCompare(spreadRepeater, "highlightedIndex", 0)1526 tryCompare(spreadRepeater, "highlightedIndex", 0)
15041527
1505 // Release control, check if spread disappears1528 // Release control, check if spread disappears
1506 keyRelease(Qt.Key_Control)1529 keyRelease(Qt.Key_Alt)
1507 tryCompare(desktopSpread, "state", "")1530 tryCompare(desktopSpread, "state", "")
15081531
1509 // Make sure that after wrapping around once, we have the same one focused as at the beginning1532 // Make sure that after wrapping around once, we have the same one focused as at the beginning
@@ -1516,7 +1539,7 @@
1516 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");1539 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1517 verify(spreadRepeater !== null);1540 verify(spreadRepeater !== null);
15181541
1519 keyPress(Qt.Key_Control)1542 keyPress(Qt.Key_Alt)
1520 keyClick(Qt.Key_Tab);1543 keyClick(Qt.Key_Tab);
1521 tryCompare(spreadRepeater, "highlightedIndex", 1);1544 tryCompare(spreadRepeater, "highlightedIndex", 1);
15221545
@@ -1538,7 +1561,7 @@
1538 keyClick(Qt.Key_Backtab);1561 keyClick(Qt.Key_Backtab);
1539 tryCompare(spreadRepeater, "highlightedIndex", 1);1562 tryCompare(spreadRepeater, "highlightedIndex", 1);
15401563
1541 keyRelease(Qt.Key_Control);1564 keyRelease(Qt.Key_Alt);
1542 }1565 }
15431566
1544 function test_highlightFollowsMouse() {1567 function test_highlightFollowsMouse() {
@@ -1547,7 +1570,7 @@
1547 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");1570 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1548 verify(spreadRepeater !== null);1571 verify(spreadRepeater !== null);
15491572
1550 keyPress(Qt.Key_Control)1573 keyPress(Qt.Key_Alt)
1551 keyClick(Qt.Key_Tab);1574 keyClick(Qt.Key_Tab);
15521575
1553 tryCompare(spreadRepeater, "highlightedIndex", 1);1576 tryCompare(spreadRepeater, "highlightedIndex", 1);
@@ -1566,7 +1589,7 @@
15661589
1567 verify(y < 4000);1590 verify(y < 4000);
15681591
1569 keyRelease(Qt.Key_Control);1592 keyRelease(Qt.Key_Alt);
1570 }1593 }
15711594
1572 function test_closeFromSpread() {1595 function test_closeFromSpread() {
@@ -1575,7 +1598,7 @@
1575 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");1598 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1576 verify(spreadRepeater !== null);1599 verify(spreadRepeater !== null);
15771600
1578 keyPress(Qt.Key_Control)1601 keyPress(Qt.Key_Alt)
1579 keyClick(Qt.Key_Tab);1602 keyClick(Qt.Key_Tab);
15801603
1581 appRemovedSpy.clear();1604 appRemovedSpy.clear();
@@ -1602,7 +1625,7 @@
1602 tryCompare(appRemovedSpy, "count", 1)1625 tryCompare(appRemovedSpy, "count", 1)
1603 compare(appRemovedSpy.signalArguments[0][0], closedAppId);1626 compare(appRemovedSpy.signalArguments[0][0], closedAppId);
16041627
1605 keyRelease(Qt.Key_Control);1628 keyRelease(Qt.Key_Alt);
1606 }1629 }
16071630
1608 function test_selectFromSpreadWithMouse_data() {1631 function test_selectFromSpreadWithMouse_data() {
@@ -1622,7 +1645,7 @@
1622 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");1645 var spreadRepeater = findInvisibleChild(shell, "spreadRepeater");
1623 verify(spreadRepeater !== null);1646 verify(spreadRepeater !== null);
16241647
1625 keyPress(Qt.Key_Control)1648 keyPress(Qt.Key_Alt)
1626 keyClick(Qt.Key_Tab);1649 keyClick(Qt.Key_Tab);
16271650
1628 var focusAppId = ApplicationManager.get(2).appId;1651 var focusAppId = ApplicationManager.get(2).appId;
@@ -1649,7 +1672,7 @@
1649 tryCompare(stage, "state", "");1672 tryCompare(stage, "state", "");
1650 tryCompare(ApplicationManager, "focusedApplicationId", focusAppId);1673 tryCompare(ApplicationManager, "focusedApplicationId", focusAppId);
16511674
1652 keyRelease(Qt.Key_Control);1675 keyRelease(Qt.Key_Alt);
1653 }1676 }
16541677
1655 function test_progressiveAutoScrolling() {1678 function test_progressiveAutoScrolling() {
@@ -1658,7 +1681,7 @@
1658 var appRepeater = findInvisibleChild(shell, "appRepeater");1681 var appRepeater = findInvisibleChild(shell, "appRepeater");
1659 verify(appRepeater !== null);1682 verify(appRepeater !== null);
16601683
1661 keyPress(Qt.Key_Control)1684 keyPress(Qt.Key_Alt)
1662 keyClick(Qt.Key_Tab);1685 keyClick(Qt.Key_Tab);
16631686
1664 var spreadFlickable = findChild(shell, "spreadFlickable")1687 var spreadFlickable = findChild(shell, "spreadFlickable")
@@ -1669,7 +1692,7 @@
1669 var x = 0;1692 var x = 0;
1670 var y = shell.height * .51693 var y = shell.height * .5
1671 mouseMove(shell, x, y)1694 mouseMove(shell, x, y)
1672 while (x <= spreadFlickable.width) {1695 while (x <= shell.width) {
1673 x+=10;1696 x+=10;
1674 mouseMove(shell, x, y)1697 mouseMove(shell, x, y)
1675 wait(0); // spin the loop so bindings get evaluated1698 wait(0); // spin the loop so bindings get evaluated
@@ -1684,7 +1707,7 @@
1684 }1707 }
1685 tryCompare(spreadFlickable, "contentX", 0);1708 tryCompare(spreadFlickable, "contentX", 0);
16861709
1687 keyRelease(Qt.Key_Control);1710 keyRelease(Qt.Key_Alt);
1688 }1711 }
16891712
1690 // This makes sure the hoverMouseArea is set to invisible AND disabled1713 // This makes sure the hoverMouseArea is set to invisible AND disabled
@@ -1696,13 +1719,13 @@
1696 tryCompare(hoverMouseArea, "enabled", false)1719 tryCompare(hoverMouseArea, "enabled", false)
1697 tryCompare(hoverMouseArea, "visible", false)1720 tryCompare(hoverMouseArea, "visible", false)
16981721
1699 keyPress(Qt.Key_Control)1722 keyPress(Qt.Key_Alt)
1700 keyClick(Qt.Key_Tab);1723 keyClick(Qt.Key_Tab);
17011724
1702 tryCompare(hoverMouseArea, "enabled", true)1725 tryCompare(hoverMouseArea, "enabled", true)
1703 tryCompare(hoverMouseArea, "visible", true)1726 tryCompare(hoverMouseArea, "visible", true)
17041727
1705 keyRelease(Qt.Key_Control)1728 keyRelease(Qt.Key_Alt)
17061729
1707 tryCompare(hoverMouseArea, "enabled", false)1730 tryCompare(hoverMouseArea, "enabled", false)
1708 tryCompare(hoverMouseArea, "visible", false)1731 tryCompare(hoverMouseArea, "visible", false)
@@ -1719,7 +1742,7 @@
1719 var appRepeater = findInvisibleChild(shell, "appRepeater");1742 var appRepeater = findInvisibleChild(shell, "appRepeater");
1720 verify(appRepeater !== null);1743 verify(appRepeater !== null);
17211744
1722 keyPress(Qt.Key_Control)1745 keyPress(Qt.Key_Alt)
1723 keyClick(Qt.Key_Tab);1746 keyClick(Qt.Key_Tab);
17241747
1725 tryCompare(spreadRepeater, "highlightedIndex", 1);1748 tryCompare(spreadRepeater, "highlightedIndex", 1);
@@ -1740,33 +1763,46 @@
17401763
1741 verify(y < 4000);1764 verify(y < 4000);
17421765
1743 keyRelease(Qt.Key_Control);1766 keyRelease(Qt.Key_Alt);
1744 }1767 }
17451768
1746 function test_focusAppFromLauncherExitsSpread() {1769 function test_focusAppFromLauncherExitsSpread_data() {
1770 return [
1771 {tag: "autohide launcher", launcherLocked: false },
1772 {tag: "locked launcher", launcherLocked: true }
1773 ]
1774 }
1775
1776 function test_focusAppFromLauncherExitsSpread(data) {
1747 loadDesktopShellWithApps()1777 loadDesktopShellWithApps()
17481778 var launcher = findChild(shell, "launcher");
1749 var desktopSpread = findChild(shell, "spread");1779 var desktopSpread = findChild(shell, "spread");
1750 var launcher = findChild(shell, "launcher");
1751 var bfb = findChild(launcher, "buttonShowDashHome");1780 var bfb = findChild(launcher, "buttonShowDashHome");
17521781
1753 keyPress(Qt.Key_Control)1782 GSettingsController.setAutohideLauncher(!data.launcherLocked);
1783 waitForRendering(shell);
1784
1785 keyPress(Qt.Key_Alt)
1754 keyClick(Qt.Key_Tab);1786 keyClick(Qt.Key_Tab);
17551787
1756 tryCompare(desktopSpread, "state", "altTab")1788 tryCompare(desktopSpread, "state", "altTab")
17571789
1758 revealLauncherByEdgePushWithMouse();1790 if (!data.launcherLocked) {
1759 tryCompare(launcher, "x", 0);1791 revealLauncherByEdgePushWithMouse();
1760 mouseMove(bfb, bfb.width / 2, bfb.height / 2)1792 tryCompare(launcher, "x", 0);
1761 waitForRendering(shell)1793 mouseMove(bfb, bfb.width / 2, bfb.height / 2)
1794 waitForRendering(shell)
1795 }
17621796
1763 mouseClick(bfb, bfb.width / 2, bfb.height / 2)1797 mouseClick(bfb, bfb.width / 2, bfb.height / 2)
1764 tryCompare(launcher, "state", "")1798 if (!data.launcherLocked) {
1799 tryCompare(launcher, "state", "")
1800 }
1765 tryCompare(desktopSpread, "state", "")1801 tryCompare(desktopSpread, "state", "")
17661802
1767 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")1803 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash")
17681804
1769 keyRelease(Qt.Key_Control);1805 keyRelease(Qt.Key_Alt);
1770 }1806 }
17711807
1772 // regression test for http://pad.lv/14433191808 // regression test for http://pad.lv/1443319
@@ -1989,6 +2025,138 @@
1989 }2025 }
1990 }2026 }
19912027
2028 function test_superTabToCycleLauncher_data() {
2029 return [
2030 {tag: "autohide launcher", launcherLocked: false},
2031 {tag: "locked launcher", launcherLocked: true}
2032 ]
2033 }
2034
2035 function test_superTabToCycleLauncher(data) {
2036 loadShell("desktop");
2037 shell.usageScenario = "desktop";
2038 GSettingsController.setAutohideLauncher(!data.launcherLocked);
2039 waitForRendering(shell);
2040
2041 var launcher = findChild(shell, "launcher");
2042 var launcherPanel = findChild(launcher, "launcherPanel");
2043 var firstAppInLauncher = LauncherModel.get(0).appId;
2044
2045 compare(launcher.state, data.launcherLocked ? "visible": "");
2046 compare(launcherPanel.highlightIndex, -2);
2047 compare(ApplicationManager.focusedApplicationId, "unity8-dash");
2048
2049 // Use Super + Tab Tab to cycle to the first entry in the launcher
2050 keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2051 keyClick(Qt.Key_Tab);
2052 tryCompare(launcher, "state", "visible");
2053 tryCompare(launcherPanel, "highlightIndex", -1);
2054 keyClick(Qt.Key_Tab);
2055 tryCompare(launcherPanel, "highlightIndex", 0);
2056 keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
2057 tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
2058 tryCompare(launcherPanel, "highlightIndex", -2);
2059 tryCompare(ApplicationManager, "focusedApplicationId", firstAppInLauncher);
2060
2061 // Now go back to the dash
2062 keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2063 keyClick(Qt.Key_Tab);
2064 tryCompare(launcher, "state", "visible");
2065 tryCompare(launcherPanel, "highlightIndex", -1);
2066 keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
2067 tryCompare(launcher, "state", data.launcherLocked ? "visible" : "");
2068 tryCompare(launcherPanel, "highlightIndex", -2);
2069 tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash");
2070 }
2071
2072 function test_longpressSuperOpensLauncher() {
2073 loadShell("desktop");
2074 var launcher = findChild(shell, "launcher");
2075 var shortcutHint = findChild(findChild(launcher, "launcherDelegate0"), "shortcutHint")
2076
2077 compare(launcher.state, "");
2078 keyPress(Qt.Key_Super_L, Qt.MetaModifier);
2079 tryCompare(launcher, "state", "visible");
2080 tryCompare(shortcutHint, "visible", true);
2081
2082 keyRelease(Qt.Key_Super_L, Qt.MetaModifier);
2083 tryCompare(launcher, "state", "");
2084 tryCompare(shortcutHint, "visible", false);
2085 }
2086
2087 function test_metaNumberLaunchesFromLauncher_data() {
2088 return [
2089 {tag: "Meta+1", key: Qt.Key_1, index: 0},
2090 {tag: "Meta+2", key: Qt.Key_2, index: 1},
2091 {tag: "Meta+4", key: Qt.Key_5, index: 4},
2092 {tag: "Meta+0", key: Qt.Key_0, index: 9},
2093 ]
2094 }
2095
2096 function test_metaNumberLaunchesFromLauncher(data) {
2097 loadShell("desktop");
2098 var launcher = findChild(shell, "launcher");
2099 var appId = LauncherModel.get(data.index).appId;
2100 waitForRendering(shell);
2101
2102 keyClick(data.key, Qt.MetaModifier);
2103 tryCompare(ApplicationManager, "focusedApplicationId", appId);
2104 }
2105
2106 function test_altF1OpensLauncherForKeyboardNavigation() {
2107 loadShell("desktop");
2108 waitForRendering(shell);
2109 var launcher = findChild(shell, "launcher");
2110
2111 keyClick(Qt.Key_F1, Qt.AltModifier);
2112 tryCompare(launcher, "state", "visible");
2113 tryCompare(launcher, "focus", true)
2114 }
2115
2116 function test_lockedOutLauncherAddsMarginsToMaximized() {
2117 loadShell("desktop");
2118 shell.usageScenario = "desktop";
2119 waitForRendering(shell);
2120 var appContainer = findChild(shell, "appContainer");
2121 var launcher = findChild(shell, "launcher");
2122
2123 var app = ApplicationManager.startApplication("music-app");
2124 waitUntilAppWindowIsFullyLoaded(app);
2125 var appDelegate = findChild(appContainer, "appDelegate_music-app");
2126 appDelegate.maximize();
2127 tryCompare(appDelegate, "visuallyMaximized", true);
2128 waitForRendering(shell);
2129
2130 GSettingsController.setAutohideLauncher(true);
2131 waitForRendering(shell)
2132 var hiddenSize = appDelegate.width;
2133
2134 GSettingsController.setAutohideLauncher(false);
2135 waitForRendering(shell)
2136 var shownSize = appDelegate.width;
2137
2138 compare(shownSize + launcher.panelWidth, hiddenSize);
2139 }
2140
2141 function test_fullscreenAppHidesLockedOutLauncher() {
2142 loadShell("desktop");
2143 shell.usageScenario = "desktop";
2144
2145 var launcher = findChild(shell, "launcher");
2146 var launcherPanel = findChild(launcher, "launcherPanel");
2147
2148 GSettingsController.setAutohideLauncher(false);
2149 waitForRendering(shell)
2150
2151 tryCompare(launcher, "lockedVisible", true);
2152
2153 var cameraApp = ApplicationManager.startApplication("camera-app");
2154 waitUntilAppWindowIsFullyLoaded(cameraApp);
2155
2156 tryCompare(launcher, "lockedVisible", false);
2157 }
2158
2159
1992 function test_inputEventsOnEdgesEndUpInAppSurface_data() {2160 function test_inputEventsOnEdgesEndUpInAppSurface_data() {
1993 return [2161 return [
1994 { tag: "phone", repeaterName: "spreadRepeater" },2162 { tag: "phone", repeaterName: "spreadRepeater" },

Subscribers

People subscribed via source and target branches