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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Lukáš Tinkl
Approved revision: 2658
Merged at revision: 2740
Proposed branch: lp:~aacid/unity8/doNotCloseLauncherContainsMouse
Merge into: lp:unity8
Diff against target: 82 lines (+17/-4)
4 files modified
plugins/Utils/globalfunctions.cpp (+5/-0)
plugins/Utils/globalfunctions.h (+2/-0)
qml/Launcher/Launcher.qml (+9/-3)
qml/Shell.qml (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity8/doNotCloseLauncherContainsMouse
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Lukáš Tinkl (community) Approve
Andrea Cimitan (community) Needs Information
Review via email: mp+308492@code.launchpad.net

Commit message

Do not hide panel when launching an application if the mouse is on the panel

Need Functions.itemUnderMouse because MouseArea.containsMouse returns true when tapping (i.e. no mouse used) on it.

Unfortunately the QML testlib do not set the proper value when issueing a mouseMove so i can't add a test that proofs it works, i'll try to propose something upstream and then add the test at a later MR

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.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

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

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

I'm wondering if instead skipping hiding we just want to delay the hiding, like starting a timer of few seconds

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

There's a design decision on what should happen as you can see on the bug.

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

I wonder why you need the flag (ignoreHideIfMouseOverLauncher)? Isn't itemUnderMouse() enough?

And as for a test, try adding some delay to the mouseMove() test function

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

> I wonder why you need the flag (ignoreHideIfMouseOverLauncher)? Isn't itemUnderMouse() enough?

No, because sometimes we do not want to ignore the hide, i.e. the call to hide(); from onLockedVisibleChanged

> And as for a test, try adding some delay to the mouseMove() test function
That won't help, i investigated more and QQuickItem::isUnderMouse uses QGuiApplicationPrivate::lastCursorPosition that is not set by the qml test functions (it bypasses that level and goes directly to the item).

I fried fixing the qml test functions but it was a big mess and i gave up, the other option would be somehow usng the qtcore tets functions that actually update properly the QGuiApplicationPrivate::lastCursorPosition value.

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

Yup, code looks good, tested and works fine.

* 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.

Passing locally

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

FAILED: Continuous integration, rev:2658
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2596/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3416
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1965
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1965
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3444
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3296
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3296/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3296
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3296/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3296
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3296/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3296
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3296/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3296
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3296/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3296
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3296/artifact/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:2658
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2653/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3486
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2005
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2005
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3514
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3361
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3361/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3361
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3361/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3361
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3361/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3361
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3361/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3361
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3361/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3361
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3361/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:2658
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2656/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3489
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2008
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2008
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3517
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3364
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3364/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3364
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3364/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3364
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3364/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3364
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3364/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3364
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3364/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3364
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3364/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Utils/globalfunctions.cpp'
2--- plugins/Utils/globalfunctions.cpp 2016-06-02 09:32:33 +0000
3+++ plugins/Utils/globalfunctions.cpp 2016-10-14 11:09:44 +0000
4@@ -51,3 +51,8 @@
5 }
6 return nullptr;
7 }
8+
9+bool GlobalFunctions::itemUnderMouse(QQuickItem* item)
10+{
11+ return item && item->isUnderMouse();
12+}
13
14=== modified file 'plugins/Utils/globalfunctions.h'
15--- plugins/Utils/globalfunctions.h 2016-03-11 20:18:12 +0000
16+++ plugins/Utils/globalfunctions.h 2016-10-14 11:09:44 +0000
17@@ -37,6 +37,8 @@
18 int x,
19 int y,
20 QJSValue matcher);
21+
22+ static Q_INVOKABLE bool itemUnderMouse(QQuickItem* item);
23 };
24
25 #endif // GLOBALFUNCTIONS_H
26
27=== modified file 'qml/Launcher/Launcher.qml'
28--- qml/Launcher/Launcher.qml 2016-08-01 11:23:49 +0000
29+++ qml/Launcher/Launcher.qml 2016-10-14 11:09:44 +0000
30@@ -19,10 +19,13 @@
31 import Ubuntu.Components 1.3
32 import Ubuntu.Gestures 0.1
33 import Unity.Launcher 0.1
34+import Utils 0.1 as Utils
35
36 FocusScope {
37 id: root
38
39+ readonly property int ignoreHideIfMouseOverLauncher: 1
40+
41 property bool autohideEnabled: false
42 property bool lockedVisible: false
43 property bool available: true // can be used to disable all interactions
44@@ -102,7 +105,10 @@
45 }
46 }
47
48- function hide() {
49+ function hide(flags) {
50+ if ((flags & ignoreHideIfMouseOverLauncher) && Utils.Functions.itemUnderMouse(panel)) {
51+ return;
52+ }
53 switchToNextState("")
54 }
55
56@@ -359,11 +365,11 @@
57 property bool animate: true
58
59 onApplicationSelected: {
60- root.hide();
61+ root.hide(ignoreHideIfMouseOverLauncher);
62 launcherApplicationSelected(appId)
63 }
64 onShowDashHome: {
65- root.hide();
66+ root.hide(ignoreHideIfMouseOverLauncher);
67 root.showDashHome();
68 }
69
70
71=== modified file 'qml/Shell.qml'
72--- qml/Shell.qml 2016-09-22 07:42:01 +0000
73+++ qml/Shell.qml 2016-10-14 11:09:44 +0000
74@@ -132,7 +132,7 @@
75 greeter.notifyAppFocusRequested(appId);
76
77 panel.indicators.hide();
78- launcher.hide();
79+ launcher.hide(launcher.ignoreHideIfMouseOverLauncher);
80 }
81
82 // For autopilot consumption

Subscribers

People subscribed via source and target branches