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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2777
Merged at revision: 2813
Proposed branch: lp:~aacid/unity8/noClickThroughMenus
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/autoOpenSubMenus
Diff against target: 77 lines (+33/-8)
3 files modified
qml/ApplicationMenus/MenuItem.qml (+0/-7)
qml/ApplicationMenus/MenuPopup.qml (+8/-1)
tests/qmltests/Stage/tst_DesktopStage.qml (+25/-0)
To merge this branch: bzr merge lp:~aacid/unity8/noClickThroughMenus
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+315662@code.launchpad.net

Commit message

Make the double click on a menu not be maximize the window below

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:2776
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3043/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3958
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2314
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2314
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3986
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3832/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3832
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3832/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
lp:~aacid/unity8/noClickThroughMenus updated
2777. By Albert Astals Cid

Merge

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

FAILED: Continuous integration, rev:2777
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3052/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3968/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3996
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3841
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3841/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3841
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3841/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3841/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3841
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3841/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3841
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3841/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3841
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3841/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:2777
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3056/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3972
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2323
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2323
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4000
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3845
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3845/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3845
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3845/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3845
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3845/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3845
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3845/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3845
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3845/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3845
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3845/artifact/output/*zip*/output.zip

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

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

tested this, it does change the behavior a bit, however, double clicking still maximizes the window behind it for me. The difference is that with trunk, the first click doesn't close the menu and the double click just goes through too and maximizes the window. With this branch, the first click makes the menu close, so the second click obviously goes to the windeco behind, however, it still counts as a double click and maximizes the window. In theory the second click should only be recognized as a single click on the windeco, given the first click has been eaten by the menu, no?

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

ok, I tested it a bit wrong. the issue it is actually supposed to fix, is fixed fine.

ci is happy too

review: Approve
lp:~aacid/unity8/noClickThroughMenus updated
2778. By Albert Astals Cid

Merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/ApplicationMenus/MenuItem.qml'
2--- qml/ApplicationMenus/MenuItem.qml 2016-12-13 09:56:20 +0000
3+++ qml/ApplicationMenus/MenuItem.qml 2017-02-07 15:46:24 +0000
4@@ -140,11 +140,4 @@
5 name: "chevron"
6 }
7 }
8-
9- MouseArea {
10- anchors.fill: parent
11- onClicked: {
12- root.trigger(action && action.checkable ? !action.checked : undefined);
13- }
14- }
15 }
16
17=== modified file 'qml/ApplicationMenus/MenuPopup.qml'
18--- qml/ApplicationMenus/MenuPopup.qml 2017-02-07 15:46:24 +0000
19+++ qml/ApplicationMenus/MenuPopup.qml 2017-02-07 15:46:24 +0000
20@@ -221,7 +221,6 @@
21 MouseArea {
22 anchors.fill: parent
23 hoverEnabled: true
24- propagateComposedEvents: true // propogate events so we send clicks to children.
25 z: 1 // on top so we override any other hovers
26 onEntered: updateCurrentItemFromPosition(Qt.point(mouseX, mouseY))
27 onPositionChanged: updateCurrentItemFromPosition(Qt.point(mouse.x, mouse.y))
28@@ -243,6 +242,14 @@
29 }
30 }
31 }
32+
33+ onClicked: {
34+ var pos = mapToItem(listView.contentItem, mouse.x, mouse.y);
35+ var clickedItem = menuColumn.childAt(pos.x, pos.y);
36+ if (clickedItem.enabled && !clickedItem.__isSeparator) {
37+ clickedItem.item.trigger();
38+ }
39+ }
40 }
41
42 ActionContext {
43
44=== modified file 'tests/qmltests/Stage/tst_DesktopStage.qml'
45--- tests/qmltests/Stage/tst_DesktopStage.qml 2017-02-07 15:46:24 +0000
46+++ tests/qmltests/Stage/tst_DesktopStage.qml 2017-02-07 15:46:24 +0000
47@@ -930,5 +930,30 @@
48 compare(menu.y, normalPositioningY);
49 }
50 }
51+
52+ function test_menuDoubleClickNoMaximizeWindowBehind() {
53+ var appDelegate1 = startApplication("dialer-app");
54+ var appDelegate2 = startApplication("gmail-webapp");
55+
56+ // Open menu
57+ var menuItem = findChild(appDelegate2, "menuBar-item3");
58+ menuItem.show();
59+ var menu = findChild(appDelegate2, "menuBar-item3-menu");
60+ menuItem = findChild(menu, "menuBar-item3-menu-item3-actionItem");
61+ tryCompare(menuItem, "visible", true);
62+
63+ // Place the other application window decoration under the menu
64+ var pos = menuItem.mapToItem(null, menuItem.width / 2, menuItem.height / 2);
65+ appDelegate1.windowedX = pos.x - appDelegate1.width / 2;
66+ appDelegate1.windowedY = pos.y - units.gu(1);
67+
68+ var previousWindowState = appDelegate1.windowState;
69+
70+ mouseMove(menuItem);
71+ mouseDoubleClickSequence(menuItem);
72+
73+ expectFail("", "Double clicking a menu should not change the window below");
74+ tryCompareFunction(function() { return appDelegate1.windowState != previousWindowState; }, true);
75+ }
76 }
77 }

Subscribers

People subscribed via source and target branches