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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 2774
Merged at revision: 2817
Proposed branch: lp:~aacid/unity8/doubleClickMaximize
Merge into: lp:unity8
Prerequisite: lp:~nick-dedekind/unity8/menu.overflow
Diff against target: 69 lines (+36/-5)
2 files modified
qml/ApplicationMenus/MenuBar.qml (+1/-1)
tests/qmltests/Stage/tst_DesktopStage.qml (+35/-4)
To merge this branch: bzr merge lp:~aacid/unity8/doubleClickMaximize
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
Daniel d'Andrada (community) Approve
Review via email: mp+316013@code.launchpad.net

This proposal supersedes a proposal from 2017-01-19.

Commit message

Make double click on the window decoration maximize

And fix test and add a new one

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 : Posted in a previous version of this proposal

FAILED: Continuous integration, rev:2770
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2965/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3864
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2255
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2255
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3892
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3737
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3737/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3737
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3737/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3737
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3737/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3737
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3737/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3737
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3737/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3737
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3737/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:2770
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2972/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3874
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2265
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2265
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3902
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3747
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3747/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3747
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3747/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3747
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3747/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3747
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3747/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3747
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3747/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3747
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3747/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal

With kate, after I double click to maximize. the cursor stays with the "closed hand" shape, as if I were dragging something.

In "make tryDesktopStage", when you double click on unity8-dash then move the mouse over the maximized tittle bar, things go crazy. Might be another symptom of the same bug. Some unresolved mouse press+release pair in some MouseArea.

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

> In "make tryDesktopStage", when you double click on unity8-dash then move the mouse over the
> maximized tittle bar, things go crazy.

Interestingly doesn't seem to happen in tryShell

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

PASSED: Continuous integration, rev:2771
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2994/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3898
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2284
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2284
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3926
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3771
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3771/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3771
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3771/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3771
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3771/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3771
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3771/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3771
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3771/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3771
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3771/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal

In test_hideMaximizeButtonWhenSizeConstrained():

"""
mouseMove(deco, deco.width - units.gu(1), deco.height/2);
"""

I think it deserves a comment on why are you clicking specifically near the right corner of the window title (ie, explain that you're evading the menu bar because double-clicking there doens't trigger maximization).

Revision history for this message
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal

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

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

PASSED: Continuous integration, rev:2772
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2997/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3901
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2287
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2287
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3929
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3774
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3774/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3774
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3774/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3774
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3774/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3774
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3774/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3774
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3774/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3774
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3774/artifact/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:2774
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3093/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4021
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2355/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2355
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4049
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3893
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3893/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3893
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3893/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3893
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3893/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3893
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3893/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3893
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3893/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3893
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3893/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:2774
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3096/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4024
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2357
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2357
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4052
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3896
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3896/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3896
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3896/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3896
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3896/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3896
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3896/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3896
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3896/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3896
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3896/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3096/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 'qml/ApplicationMenus/MenuBar.qml'
2--- qml/ApplicationMenus/MenuBar.qml 2017-01-31 14:13:14 +0000
3+++ qml/ApplicationMenus/MenuBar.qml 2017-01-31 14:13:14 +0000
4@@ -219,7 +219,7 @@
5 } // Row
6
7 MouseArea {
8- anchors.fill: parent
9+ anchors.fill: row
10 hoverEnabled: d.currentItem
11
12 onEntered: {
13
14=== modified file 'tests/qmltests/Stage/tst_DesktopStage.qml'
15--- tests/qmltests/Stage/tst_DesktopStage.qml 2017-01-31 14:13:14 +0000
16+++ tests/qmltests/Stage/tst_DesktopStage.qml 2017-01-31 14:13:14 +0000
17@@ -698,10 +698,18 @@
18 var sizeBefore = Qt.size(dialerDelegate.width, dialerDelegate.height);
19 var deco = findChild(dialerDelegate, "appWindowDecoration");
20 verify(deco);
21- tryCompare(deco, "maximizeButtonShown", false);
22- mouseDoubleClick(deco);
23- var sizeAfter = Qt.size(dialerDelegate.width, dialerDelegate.height);
24- tryCompareFunction(function(){ return sizeBefore; }, sizeAfter);
25+ // deco.width - units.gu(1) to make sure we're outside the "menu" area of the decoration
26+ mouseMove(deco, deco.width - units.gu(1), deco.height/2);
27+ var menuBarLoader = findChild(deco, "menuBarLoader");
28+ tryCompare(menuBarLoader.item, "visible", true);
29+ mouseDoubleClick(deco, deco.width - units.gu(1), deco.height/2)
30+ expectFail("", "Double click should not maximize in a size restricted window");
31+ tryCompareFunction(function() {
32+ var sizeAfter = Qt.size(dialerDelegate.width, dialerDelegate.height);
33+ return sizeAfter.width > sizeBefore.width && sizeAfter.height > sizeBefore.height;
34+ },
35+ true
36+ );
37
38 // remove restrictions, the maximize button should again be visible
39 dialerDelegate.surface.setMaximumWidth(0);
40@@ -709,6 +717,29 @@
41 tryCompare(dialerMaximizeButton, "visible", true);
42 }
43
44+ function test_doubleClickMaximizes() {
45+ var dialerDelegate = startApplication("dialer-app");
46+
47+ var dialerMaximizeButton = findChild(dialerDelegate, "maximizeWindowButton");
48+ tryCompare(dialerMaximizeButton, "visible", true);
49+
50+ // try double clicking the decoration, should maximize it
51+ var sizeBefore = Qt.size(dialerDelegate.width, dialerDelegate.height);
52+ var deco = findChild(dialerDelegate, "appWindowDecoration");
53+ verify(deco);
54+ // deco.width - units.gu(1) to make sure we're outside the "menu" area of the decoration
55+ mouseMove(deco, deco.width - units.gu(1), deco.height/2);
56+ var menuBarLoader = findChild(deco, "menuBarLoader");
57+ tryCompare(menuBarLoader.item, "visible", true);
58+ mouseDoubleClick(deco, deco.width - units.gu(1), deco.height/2);
59+ tryCompareFunction(function() {
60+ var sizeAfter = Qt.size(dialerDelegate.width, dialerDelegate.height);
61+ return sizeAfter.width > sizeBefore.width && sizeAfter.height > sizeBefore.height;
62+ },
63+ true
64+ );
65+ }
66+
67 function test_canMoveWindowWithLeftMouseButtonOnly_data() {
68 return [
69 {tag: "left mouse button", button: Qt.LeftButton },

Subscribers

People subscribed via source and target branches