Merge lp:~azzar1/unity8/dragging-cursor-on-first-press into lp:unity8

Proposed by Andrea Azzarone
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: 2610
Merged at revision: 2711
Proposed branch: lp:~azzar1/unity8/dragging-cursor-on-first-press
Merge into: lp:unity8
Prerequisite: lp:~mzanetti/unity8/unified-stages
Diff against target: 215 lines (+124/-2)
6 files modified
qml/Stage/MoveHandler.qml (+8/-0)
tests/mocks/Unity/Application/CMakeLists.txt (+1/-0)
tests/mocks/Unity/Application/MirMock.cpp (+49/-0)
tests/mocks/Unity/Application/MirMock.h (+39/-0)
tests/mocks/Unity/Application/plugin.cpp (+11/-2)
tests/qmltests/Stage/tst_DesktopStage.qml (+16/-0)
To merge this branch: bzr merge lp:~azzar1/unity8/dragging-cursor-on-first-press
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Abstain
Unity8 CI Bot continuous-integration Approve
Lukáš Tinkl (community) Approve
Review via email: mp+307830@code.launchpad.net

This proposal supersedes a proposal from 2016-08-29.

Commit message

Set Mir.cursorName to "grabbing" on first mouse press on a window decoration. Don't wait for press+motion.

Description of the change

* Are there any related MPs required for this MP to build/function as expected?
Yes, lp:~mzanetti/unity8/unified-stages but it's merged and listed as prerequisite.

 * Did you perform an exploratory manual test run of your code change and any related functionality?
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?
Not a visual change. The behavior is now similar to unity7 and all major DEs.

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

FAILED: Continuous integration, rev:2602
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2053/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2697
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1484
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1484
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1484
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2725
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2598
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2598
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2598
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2591/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2591
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2591/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal

It doesn't work correctly when you double-click the decoration (to maximize the window)

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2603
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2063/
Executed test runs:

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Azzarone (azzar1) wrote : Posted in a previous version of this proposal

Fixed!

Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Text conflict in qml/Stages/WindowDecoration.qml
1 conflicts encountered.

Also, should we have a test?

review: Needs Fixing
Revision history for this message
Andrea Azzarone (azzar1) wrote : Posted in a previous version of this proposal

> Text conflict in qml/Stages/WindowDecoration.qml
> 1 conflicts encountered.
>
> Also, should we have a test?

Yeah I tried to add a test but asserting for Mir.Cursor does not work.

Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

> > Text conflict in qml/Stages/WindowDecoration.qml
> > 1 conflicts encountered.
> >
> > Also, should we have a test?
>
> Yeah I tried to add a test but asserting for Mir.Cursor does not work.

What do you mean it does not work?

Revision history for this message
Andrea Azzarone (azzar1) wrote : Posted in a previous version of this proposal

> > > Text conflict in qml/Stages/WindowDecoration.qml
> > > 1 conflicts encountered.
> > >
> > > Also, should we have a test?
> >
> > Yeah I tried to add a test but asserting for Mir.Cursor does not work.
>
> What do you mean it does not work?

Mir.cursorName is always "undefined" when running tests. Likely it requires a Mir session.

Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

Conflicts with https://code.launchpad.net/~mzanetti/unity8/unified-stages/+merge/305588

Given how unified-stages is our focus on landing ASAP i'd suggest you rebase on top of it.

Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

> Mir.cursorName is always "undefined" when running tests. Likely it requires a
> Mir session.

No, it does not, Mir.cursorName in "real life" is provided by qtmir's Unity.Application plugin (./src/modules/Unity/Application/plugin.cpp), what we need is update our mock plugin tests/mocks/Unity/Application so that it provides a "Mir" object that is in line with what the real world one does.

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal

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

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

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

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

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

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

Should we remove the

qmlRegisterUncreatableType<Mir>(uri, 0, 1, "Mir", "Mir provides enum values, it can't be instantiated");

line from the mock plugin.cpp?

Declaring Mir both a singleton an uncreatable is a bit weird, no?

review: Needs Information
Revision history for this message
Andrea Azzarone (azzar1) wrote :

> Should we remove the
>
> qmlRegisterUncreatableType<Mir>(uri, 0, 1, "Mir", "Mir provides enum values,
> it can't be instantiated");
>
> line from the mock plugin.cpp?
>
> Declaring Mir both a singleton an uncreatable is a bit weird, no?

Fixed thanks.

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

PASSED: Continuous integration, rev:2609
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2422/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3176
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1813
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1813
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1813
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3204
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3060/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/3060
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/3060/artifact/output/*zip*/output.zip

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

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

Code looks good.

BUT

When i use it on my computer i don't get a dragging icon at all and terminal says

[2016-10-14:12:19:38.650] CursorImageProvider: "grabbing" not found (nor its fallbacks, if any). Going for "left_ptr" as a last resort.

This is a realtively clean user and a relatively new install.

Any idea what may be wrong?

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

Worked fine here, just tested it

Only wondering where does this magic constant "175" for the timer coming from? :)

review: Approve
Revision history for this message
Andrea Azzarone (azzar1) wrote :

> Worked fine here, just tested it
>
> Only wondering where does this magic constant "175" for the timer coming from?
> :)

It's the same we have in unity7.

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

OK, no objections from me then :)

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

Text conflict in tests/qmltests/Stage/tst_DesktopStage.qml
1 conflicts encountered.

Note: Was already top approved

review: Needs Fixing
2610. By Andrea Azzarone

Merge with trunk and resolve conflicts.

Revision history for this message
Andrea Azzarone (azzar1) wrote :

> Text conflict in tests/qmltests/Stage/tst_DesktopStage.qml
> 1 conflicts encountered.
>
> Note: Was already top approved

Fixed.

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

PASSED: Continuous integration, rev:2610
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2457/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3231
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1853
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1853
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1853
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3259
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3113/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3113
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3113/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) :
review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Stage/MoveHandler.qml'
--- qml/Stage/MoveHandler.qml 2016-09-27 15:03:00 +0000
+++ qml/Stage/MoveHandler.qml 2016-10-28 12:29:16 +0000
@@ -54,6 +54,11 @@
54 property bool nearBottomLeftCorner: target.maximizedBottomLeft54 property bool nearBottomLeftCorner: target.maximizedBottomLeft
55 property bool nearBottomRightCorner: target.maximizedBottomRight55 property bool nearBottomRightCorner: target.maximizedBottomRight
5656
57 property Timer mouseDownTimer: Timer {
58 interval: 175
59 onTriggered: Mir.cursorName = "grabbing"
60 }
61
57 function resetEdges() {62 function resetEdges() {
58 nearLeftEdge = false;63 nearLeftEdge = false;
59 nearRightEdge = false;64 nearRightEdge = false;
@@ -93,14 +98,17 @@
93 }98 }
9499
95 priv.dragging = true;100 priv.dragging = true;
101 priv.mouseDownTimer.start();
96 } else {102 } else {
97 priv.dragging = false;103 priv.dragging = false;
104 priv.mouseDownTimer.stop();
98 Mir.cursorName = "";105 Mir.cursorName = "";
99 }106 }
100 }107 }
101108
102 function handlePositionChanged(mouse, sensingPoints) {109 function handlePositionChanged(mouse, sensingPoints) {
103 if (priv.dragging) {110 if (priv.dragging) {
111 priv.mouseDownTimer.stop();
104 Mir.cursorName = "grabbing";112 Mir.cursorName = "grabbing";
105113
106 // restore from maximized when dragging away from edges/corners; guard against inadvertent changes when going into maximized state114 // restore from maximized when dragging away from edges/corners; guard against inadvertent changes when going into maximized state
107115
=== modified file 'tests/mocks/Unity/Application/CMakeLists.txt'
--- tests/mocks/Unity/Application/CMakeLists.txt 2016-06-30 13:51:32 +0000
+++ tests/mocks/Unity/Application/CMakeLists.txt 2016-10-28 12:29:16 +0000
@@ -5,6 +5,7 @@
5 MirSurface.cpp5 MirSurface.cpp
6 MirSurfaceItem.cpp6 MirSurfaceItem.cpp
7 MirSurfaceListModel.cpp7 MirSurfaceListModel.cpp
8 MirMock.cpp
8 ObjectListModel.h9 ObjectListModel.h
9 SurfaceManager.cpp10 SurfaceManager.cpp
10 VirtualKeyboard.cpp11 VirtualKeyboard.cpp
1112
=== added file 'tests/mocks/Unity/Application/MirMock.cpp'
--- tests/mocks/Unity/Application/MirMock.cpp 1970-01-01 00:00:00 +0000
+++ tests/mocks/Unity/Application/MirMock.cpp 2016-10-28 12:29:16 +0000
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "MirMock.h"
18
19MirMock *MirMock::the_mir = nullptr;
20
21MirMock *MirMock::instance()
22{
23 return the_mir;
24}
25
26MirMock::MirMock()
27{
28 Q_ASSERT(the_mir == nullptr);
29 the_mir = this;
30}
31
32MirMock::~MirMock()
33{
34 Q_ASSERT(the_mir == this);
35 the_mir = nullptr;
36}
37
38void MirMock::setCursorName(const QString &cursorName)
39{
40 if (cursorName != m_cursorName) {
41 m_cursorName = cursorName;
42 Q_EMIT cursorNameChanged(m_cursorName);
43 }
44}
45
46QString MirMock::cursorName() const
47{
48 return m_cursorName;
49}
050
=== added file 'tests/mocks/Unity/Application/MirMock.h'
--- tests/mocks/Unity/Application/MirMock.h 1970-01-01 00:00:00 +0000
+++ tests/mocks/Unity/Application/MirMock.h 2016-10-28 12:29:16 +0000
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef MIR_MOCK_H
18#define MIR_MOCK_H
19
20#include <unity/shell/application/Mir.h>
21
22class MirMock : public ::Mir
23{
24 Q_OBJECT
25public:
26 explicit MirMock();
27 virtual ~MirMock();
28
29 static MirMock *instance();
30
31 void setCursorName(const QString &cursorName) override;
32 QString cursorName() const override;
33
34private:
35 static MirMock *the_mir;
36 QString m_cursorName;
37};
38
39#endif
040
=== modified file 'tests/mocks/Unity/Application/plugin.cpp'
--- tests/mocks/Unity/Application/plugin.cpp 2016-06-30 13:51:32 +0000
+++ tests/mocks/Unity/Application/plugin.cpp 2016-10-28 12:29:16 +0000
@@ -17,6 +17,7 @@
17#include "plugin.h"17#include "plugin.h"
18#include "ApplicationInfo.h"18#include "ApplicationInfo.h"
19#include "ApplicationManager.h"19#include "ApplicationManager.h"
20#include "MirMock.h"
20#include "MirSurfaceItem.h"21#include "MirSurfaceItem.h"
21#include "SurfaceManager.h"22#include "SurfaceManager.h"
2223
@@ -38,6 +39,9 @@
38 if (!SurfaceManager::instance()) {39 if (!SurfaceManager::instance()) {
39 new SurfaceManager;40 new SurfaceManager;
40 }41 }
42 if (!MirMock::instance()) {
43 new MirMock;
44 }
41}45}
4246
43QObject* applicationManagerSingleton(QQmlEngine*, QJSEngine*)47QObject* applicationManagerSingleton(QQmlEngine*, QJSEngine*)
@@ -46,6 +50,12 @@
46 return new ApplicationManager;50 return new ApplicationManager;
47}51}
4852
53QObject* mirSingleton(QQmlEngine*, QJSEngine*)
54{
55 createUnityApplicationSharedSingletons();
56 return MirMock::instance();
57}
58
49QObject* surfaceManagerSingleton(QQmlEngine*, QJSEngine*)59QObject* surfaceManagerSingleton(QQmlEngine*, QJSEngine*)
50{60{
51 createUnityApplicationSharedSingletons();61 createUnityApplicationSharedSingletons();
@@ -78,9 +88,8 @@
78 qmlRegisterType<ApplicationInfo>(uri, 0, 1, "ApplicationInfo");88 qmlRegisterType<ApplicationInfo>(uri, 0, 1, "ApplicationInfo");
7989
80 qmlRegisterSingletonType<ApplicationManager>(uri, 0, 1, "ApplicationManager", applicationManagerSingleton);90 qmlRegisterSingletonType<ApplicationManager>(uri, 0, 1, "ApplicationManager", applicationManagerSingleton);
91 qmlRegisterSingletonType<MirMock>(uri, 0, 1, "Mir", mirSingleton);
81 qmlRegisterSingletonType<SurfaceManager>(uri, 0, 1, "SurfaceManager", surfaceManagerSingleton);92 qmlRegisterSingletonType<SurfaceManager>(uri, 0, 1, "SurfaceManager", surfaceManagerSingleton);
82
83 qmlRegisterUncreatableType<Mir>(uri, 0, 1, "Mir", "Mir provides enum values, it can't be instantiated");
84}93}
8594
86void FakeUnityApplicationQmlPlugin::initializeEngine(QQmlEngine *engine, const char *uri)95void FakeUnityApplicationQmlPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
8796
=== modified file 'tests/qmltests/Stage/tst_DesktopStage.qml'
--- tests/qmltests/Stage/tst_DesktopStage.qml 2016-09-27 15:03:00 +0000
+++ tests/qmltests/Stage/tst_DesktopStage.qml 2016-10-28 12:29:16 +0000
@@ -788,5 +788,21 @@
788788
789 tryCompare(dialerAppDelegate, "state", "maximized");789 tryCompare(dialerAppDelegate, "state", "maximized");
790 }790 }
791
792 function test_grabbingCursorOnDecorationPress() {
793 var appDelegate = startApplication("dialer-app");
794 verify(appDelegate);
795 var decoration = findChild(appDelegate, "appWindowDecoration");
796 verify(decoration);
797
798 mousePress(decoration, decoration.width/2, decoration.height/2, Qt.LeftButton);
799 tryCompare(Mir, "cursorName", "grabbing");
800
801 mouseMove(decoration, decoration.width/2 + 1, decoration.height/2 + 1);
802 tryCompare(Mir, "cursorName", "grabbing");
803
804 mouseRelease(decoration);
805 tryCompare(Mir, "cursorName", "");
806 }
791 }807 }
792}808}

Subscribers

People subscribed via source and target branches