Merge lp:~lukas-kde/unity8/eatDecorationMouseEvents into lp:unity8

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 2447
Merged at revision: 2508
Proposed branch: lp:~lukas-kde/unity8/eatDecorationMouseEvents
Merge into: lp:unity8
Prerequisite: lp:~lukas-kde/unity8/preventScrollThruShellElements
Diff against target: 114 lines (+61/-4)
2 files modified
qml/Stages/WindowDecoration.qml (+10/-4)
tests/qmltests/Stages/tst_DesktopStage.qml (+51/-0)
To merge this branch: bzr merge lp:~lukas-kde/unity8/eatDecorationMouseEvents
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Michał Sawicz Needs Fixing
Daniel d'Andrada (community) Approve
Review via email: mp+297511@code.launchpad.net

This proposal supersedes a proposal from 2016-06-03.

Commit message

Do not let mouse and wheel events pass thru the titlebar

Description of the change

Do not let mouse and wheel events pass thru the titlebar

* Are there any related MPs required for this MP to build/function as expected? Please list.

Yes, see prereq

* 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
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal

"""
- hoverEnabled: true
"""

So you never needed hover events in that MouseArea?

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

> """
> - hoverEnabled: true
> """
>
> So you never needed hover events in that MouseArea?

Correct, they are needed in WindowControlButtons but not here

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

PASSED: Continuous integration, rev:2442
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1376/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1841
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/925
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/925
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/925
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1867
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1805
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1805
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1805
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1796/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1796
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1796/artifact/output/*zip*/output.zip

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

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

You're now able to move the window around by dragging with any mouse button pressed.

Please write a regression test for that

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

What about having the test in a tst_WindowDecoration instead of in tst_DesktopStage? No need to involve the whole desktop stage.

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

And please try to make tests a such a way that they can be executed manually in "make tryFoo". For this specific case, see "make tryPanel" for an example. It's background goes read when a mouse press reaches it.

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

> It's background goes read when a mouse press reaches it.

s/It's/Its
s/read/red

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

> And please try to make tests a such a way that they can be executed manually
> in "make tryFoo". For this specific case, see "make tryPanel" for an example.
> It's background goes read when a mouse press reaches it.

The functionality can be tried out in either make tryShell or make tryDesktopStage.

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

> You're now able to move the window around by dragging with any mouse button
> pressed.
>
> Please write a regression test for that

Thanks for spotting, fixed! Also corrected the test so that it checks for the "pressed" signal instead of "clicked" (which was the source of this "regression").

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

FAILED: Continuous integration, rev:2443
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1455/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/1933
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/993
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/993
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/993
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1959
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1894
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1894
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1894
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1885/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1885
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1885/artifact/output/*zip*/output.zip

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

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

Imagine the replacement of all stages with a single, new, one that mzanetti is working on. With this branch, there's yet another test he has to juggle around and mind about. But it's unnecessary as the test is not about stages code. It's a DecoratedWindow internal detail he shouldn't bother about when refactoring stages code.

It would make our qmltests code base more modular if this was moved to a tst_DecoratedWindow or a tst_WindowDecoration (ie, having it as, or closer to being, a unit test). Unless you think it's interesting to also exercise surrounding code along with it (ie, as a integration test). But following this rationale we could just as well move it to tst_OrientedShell...

In short: I believe this test looks more like (as is best as) a unit test then a integration test

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

- Move mouse over the window decoration
   * mouse cursor shape is an arrow)
- Press left mouse button over the window decoration
- Move mouse (window is dragged along)
   * mouse cursor shape is a closed hand
- Lift left mouse button

expected outcome:
Mouse cursor shape is an arrow once again

actual outcome:
Mouse cursor shape remains a closed hand. Moving it over a window border fixes it.

review: Needs Fixing
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote : Posted in a previous version of this proposal
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
review: Needs Fixing (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal

> - Move mouse over the window decoration
> * mouse cursor shape is an arrow)
> - Press left mouse button over the window decoration
> - Move mouse (window is dragged along)
> * mouse cursor shape is a closed hand
> - Lift left mouse button
>
> expected outcome:
> Mouse cursor shape is an arrow once again
>
> actual outcome:
> Mouse cursor shape remains a closed hand. Moving it over a window border fixes
> it.

Fixed, and also added another test for checking for moving/dragging the window with different mouse buttons.

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

I'm getting a conflict in tests/qmltests/Stages/tst_DesktopStage.qml when trying to merge it with its prerequisite.

Revision history for this message
Daniel d'Andrada (dandrader) :
review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

$ bzr branch lp:unity8 foo
$ cd foo
$ bzr merge lp:~lukas-kde/unity8/preventScrollThruShellElements && bzr commit -m"Merge lp:~lukas-$ kde/unity8/preventScrollThruShellElements"
$ bzr merge lp:~lukas-kde/unity8/eatDecorationMouseEvents

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

* 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, due to missing dependencies. Affected test passes locally though.

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

FAILED: Continuous integration, rev:2446
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1495/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/1994/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2022
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1939
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1939
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1939
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1931/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1931/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1495/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
Michał Sawicz (saviq) wrote :

Text conflict in qml/Stages/WindowDecoration.qml

review: Needs Fixing
2447. By Lukáš Tinkl

merge trunk, resolve conflicts

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

Merged trunk, conflict resolved

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

FAILED: Continuous integration, rev:2447
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1551/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2063
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1068
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1068/console
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1068
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2091
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2002
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2002
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2002
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1993/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1993
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1993/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1551/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 'qml/Stages/WindowDecoration.qml'
2--- qml/Stages/WindowDecoration.qml 2016-06-17 01:14:28 +0000
3+++ qml/Stages/WindowDecoration.qml 2016-06-20 09:51:09 +0000
4@@ -27,17 +27,20 @@
5 property Item target
6 property alias title: titleLabel.text
7 property bool active: false
8+ acceptedButtons: Qt.AllButtons // prevent leaking unhandled mouse events
9 property alias overlayShown: buttons.overlayShown
10
11- hoverEnabled: true
12-
13 signal closeClicked()
14 signal minimizeClicked()
15 signal maximizeClicked()
16 signal maximizeHorizontallyClicked()
17 signal maximizeVerticallyClicked()
18
19- onDoubleClicked: root.maximizeClicked()
20+ onDoubleClicked: {
21+ if (mouse.button == Qt.LeftButton) {
22+ root.maximizeClicked();
23+ }
24+ }
25
26 QtObject {
27 id: priv
28@@ -47,7 +50,7 @@
29 }
30
31 onPressedChanged: {
32- if (pressed) {
33+ if (pressed && pressedButtons == Qt.LeftButton) {
34 var pos = mapToItem(root.target, mouseX, mouseY);
35 priv.distanceX = pos.x;
36 priv.distanceY = pos.y;
37@@ -70,6 +73,9 @@
38 }
39 }
40
41+ // do not let unhandled wheel event pass thru the decoration
42+ onWheel: wheel.accepted = true;
43+
44 Rectangle {
45 anchors.fill: parent
46 anchors.bottomMargin: -radius
47
48=== modified file 'tests/qmltests/Stages/tst_DesktopStage.qml'
49--- tests/qmltests/Stages/tst_DesktopStage.qml 2016-06-20 09:51:09 +0000
50+++ tests/qmltests/Stages/tst_DesktopStage.qml 2016-06-20 09:51:09 +0000
51@@ -691,6 +691,28 @@
52 tryCompare(closeButton, "visible", false);
53 }
54
55+ function test_canMoveWindowWithLeftMouseButtonOnly_data() {
56+ return [
57+ {tag: "left mouse button", button: Qt.LeftButton },
58+ {tag: "right mouse button", button: Qt.RightButton },
59+ {tag: "middle mouse button", button: Qt.MiddleButton }
60+ ]
61+ }
62+
63+ function test_canMoveWindowWithLeftMouseButtonOnly(data) {
64+ var appDelegate = startApplication("dialer-app");
65+ verify(appDelegate);
66+
67+ var posBefore = Qt.point(appDelegate.x, appDelegate.y);
68+
69+ mousePress(appDelegate, appDelegate.width / 2, units.gu(1), data.button);
70+ mouseMove(appDelegate, appDelegate.width / 2, -units.gu(100), undefined /* delay */, data.button);
71+
72+ var posAfter = Qt.point(appDelegate.x, appDelegate.y);
73+
74+ tryCompareFunction(function(){return posBefore == posAfter;}, data.button !== Qt.LeftButton ? true : false);
75+ }
76+
77 function test_preventMouseEventsThruDesktopSpread() {
78 var spread = findChild(desktopStage, "spread");
79 verify(spread);
80@@ -708,5 +730,34 @@
81
82 spread.cancel();
83 }
84+
85+ function test_eatWindowDecorationMouseEvents_data() {
86+ return [
87+ {tag: "left mouse click", signalName: "clicked", button: Qt.LeftButton },
88+ {tag: "right mouse click", signalName: "clicked", button: Qt.RightButton },
89+ {tag: "middle mouse click", signalName: "clicked", button: Qt.MiddleButton },
90+ {tag: "mouse wheel", signalName: "wheel", button: Qt.MiddleButton },
91+ {tag: "double click (RMB)", signalName: "doubleClicked", button: Qt.RightButton },
92+ ]
93+ }
94+
95+ function test_eatWindowDecorationMouseEvents(data) {
96+ var dialerAppDelegate = startApplication("dialer-app");
97+ verify(dialerAppDelegate);
98+ var decoration = findChild(dialerAppDelegate, "appWindowDecoration");
99+ verify(decoration);
100+
101+ mouseEaterSpy.signalName = data.signalName;
102+ if (data.signalName === "wheel") {
103+ mouseWheel(decoration, decoration.width/2, decoration.height/2, 20, 20);
104+ } else if (data.signalName === "clicked") {
105+ mouseClick(decoration, decoration.width/2, decoration.height/2, data.button);
106+ } else {
107+ mouseDoubleClick(decoration, decoration.width/2, decoration.height/2, data.button);
108+ tryCompare(dialerAppDelegate, "maximized", false);
109+ }
110+
111+ tryCompare(mouseEaterSpy, "count", 0);
112+ }
113 }
114 }

Subscribers

People subscribed via source and target branches