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

Proposed by Albert Astals Cid on 2016-06-14
Status: Merged
Approved by: Michał Sawicz on 2016-06-20
Approved revision: 2444
Merged at revision: 2507
Proposed branch: lp:~aacid/unity8/dont_let_mouse_outside_item
Merge into: lp:unity8
Diff against target: 25 lines (+5/-5)
1 file modified
plugins/Cursor/MousePointer.cpp (+5/-5)
To merge this branch: bzr merge lp:~aacid/unity8/dont_let_mouse_outside_item
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing on 2016-06-22
Michał Sawicz Needs Fixing on 2016-06-18
Daniel d'Andrada (community) 2016-06-14 Approve on 2016-06-14
Review via email: mp+297342@code.launchpad.net

Commit Message

Don't let the mouse go outside the parentItem

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

 * 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.
Daniel d'Andrada (dandrader) wrote :

Looks good

review: Approve (code)
Daniel d'Andrada (dandrader) wrote :

It's good enough as it is, although would be nice to have these improvements:

- Update copyright header of plugins/Cursor/MousePointer.cpp

In "Q_EMIT pushedRightBoundary(newX - parentItem()->width(), buttons);"

To be consistent it should now be:

Q_EMIT pushedRightBoundary(newX - (parentItem()->width() - 1), buttons);

* 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.
No results yet. But that's not particularly relevant as this patch doesn't change code that affects any test.

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2442
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1472/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1966
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1010
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1010
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1010
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1992
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1926
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1926
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1926
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1917/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1917
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1917/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Michał Sawicz (saviq) wrote :

Text conflict in plugins/Cursor/MousePointer.cpp

review: Needs Fixing
2444. By Albert Astals Cid on 2016-06-20

Merge

Albert Astals Cid (aacid) wrote :

> Text conflict in plugins/Cursor/MousePointer.cpp

Merged, only conflict was the way of change copyright year.

Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2444
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1548/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2057
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1062/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1062
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1062/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2085
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1996
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1996
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1996
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1987
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1987

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

review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Cursor/MousePointer.cpp'
2--- plugins/Cursor/MousePointer.cpp 2016-06-17 01:13:22 +0000
3+++ plugins/Cursor/MousePointer.cpp 2016-06-20 07:27:53 +0000
4@@ -52,17 +52,17 @@
5 if (newX < 0) {
6 Q_EMIT pushedLeftBoundary(qAbs(newX), buttons);
7 newX = 0;
8- } else if (newX > parentItem()->width()) {
9- Q_EMIT pushedRightBoundary(newX - parentItem()->width(), buttons);
10- newX = parentItem()->width();
11+ } else if (newX >= parentItem()->width()) {
12+ Q_EMIT pushedRightBoundary(newX - (parentItem()->width() - 1), buttons);
13+ newX = parentItem()->width() - 1;
14 }
15 setX(newX);
16
17 qreal newY = y() + appliedMovement.y();
18 if (newY < 0) {
19 newY = 0;
20- } else if (newY > parentItem()->height()) {
21- newY = parentItem()->height();
22+ } else if (newY >= parentItem()->height()) {
23+ newY = parentItem()->height() - 1;
24 }
25 setY(newY);
26

Subscribers

People subscribed via source and target branches