Merge lp:~mzanetti/unity8/fix-occlusion-detection into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Nick Dedekind
Approved revision: 2059
Merged at revision: 2094
Proposed branch: lp:~mzanetti/unity8/fix-occlusion-detection
Merge into: lp:unity8
Diff against target: 109 lines (+51/-7)
3 files modified
qml/Stages/DesktopStage.qml (+10/-7)
tests/qmltests/Stages/tst_DesktopStage.qml (+40/-0)
tests/qmltests/tst_Shell.qml (+1/-0)
To merge this branch: bzr merge lp:~mzanetti/unity8/fix-occlusion-detection
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Nick Dedekind (community) Approve
Daniel d'Andrada (community) Abstain
Review via email: mp+278637@code.launchpad.net

Commit message

Use proper z ordering instead of app index for occlusion detection

Description of the change

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

nope

 * Did you perform an exploratory manual test run of your code change and any related functionality?

y

 * Did you make sure that your branch does not contain spurious tags?

y

 * 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
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2059
http://jenkins.qa.ubuntu.com/job/unity8-ci/6842/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5501
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/257/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1553
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/256/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1448
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1448
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/255
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/254
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4320
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5515
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5515/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25640
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/89/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/256
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/256/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25639

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6842/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) :
review: Abstain
Revision history for this message
Michael Zanetti (mzanetti) wrote :

hmm... can't repro that test failure here... re-triggered jenkins to see if it's flakiness.

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

me neither. All is ok here.
Code looks fine & tests pass.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2059
http://jenkins.qa.ubuntu.com/job/unity8-ci/6875/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5570
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/290/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1586
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/289
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1481
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1481
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/288
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/287
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4363
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5584
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5584/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25771
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/107/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/289
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/289/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25770

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6875/rebuild

review: Needs Fixing (continuous-integration)
2060. By Michael Zanetti

stabilize test (not really related to that branch but lets keep Jenkins happy)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stages/DesktopStage.qml'
2--- qml/Stages/DesktopStage.qml 2015-11-26 13:34:05 +0000
3+++ qml/Stages/DesktopStage.qml 2015-12-03 15:31:00 +0000
4@@ -123,17 +123,17 @@
5 }
6 onFocusedAppDelegateChanged: updateForegroundMaximizedApp();
7
8- property int foregroundMaximizedAppIdIndex: -1
9+ property int foregroundMaximizedAppZ: -1
10
11 function updateForegroundMaximizedApp() {
12- for (var i = 0; i < appRepeater.count; i++) {
13+ var tmp = -1;
14+ for (var i = appRepeater.count - 1; i >= 0; i--) {
15 var item = appRepeater.itemAt(i);
16 if (item && item.visuallyMaximized) {
17- foregroundMaximizedAppIdIndex = i;
18- return;
19+ tmp = Math.max(tmp, item.normalZ);
20 }
21 }
22- foregroundMaximizedAppIdIndex = -1;
23+ foregroundMaximizedAppZ = tmp;
24 }
25
26 function indexOf(appId) {
27@@ -237,7 +237,10 @@
28 delegate: FocusScope {
29 id: appDelegate
30 objectName: "appDelegate_" + appId
31- z: ApplicationManager.count - index
32+ // z might be overriden in some cases by effects, but we need z ordering
33+ // to calculate occlusion detection
34+ property int normalZ: ApplicationManager.count - index
35+ z: normalZ
36 y: PanelState.panelHeight
37 focus: appId === priv.focusedAppId
38 width: decoratedWindow.width
39@@ -274,7 +277,7 @@
40
41 visible: !visuallyMinimized &&
42 !greeter.fullyShown &&
43- (priv.foregroundMaximizedAppIdIndex === -1 || priv.foregroundMaximizedAppIdIndex >= index) ||
44+ (priv.foregroundMaximizedAppZ === -1 || priv.foregroundMaximizedAppZ <= z) ||
45 (spread.state == "altTab" && index === spread.highlightedIndex)
46
47 Binding {
48
49=== modified file 'tests/qmltests/Stages/tst_DesktopStage.qml'
50--- tests/qmltests/Stages/tst_DesktopStage.qml 2015-11-24 17:44:18 +0000
51+++ tests/qmltests/Stages/tst_DesktopStage.qml 2015-12-03 15:31:00 +0000
52@@ -458,5 +458,45 @@
53 compare(dialerDelegate.visible, true, "Dialer should be visible");
54 compare(dashDelegate.visible, true, "Dash should still be visible");
55 }
56+
57+ function test_occlusionWithMultipleMaximized() {
58+ var dashApp = startApplication("unity8-dash");
59+ var dashAppDelegate = findChild(desktopStage, "appDelegate_unity8-dash");
60+
61+ var dialerApp = startApplication("dialer-app");
62+ var dialerAppDelegate = findChild(desktopStage, "appDelegate_dialer-app");
63+
64+ var facebookApp = startApplication("facebook-webapp");
65+ var facebookAppDelegate = findChild(desktopStage, "appDelegate_facebook-webapp");
66+
67+ // all of them are in restored state now. all should be visible
68+ tryCompare(dashAppDelegate, "visible", true);
69+ tryCompare(dialerAppDelegate, "visible", true);
70+ tryCompare(facebookAppDelegate, "visible", true);
71+
72+ // Maximize the topmost and make sure the other two are hidden
73+ facebookAppDelegate.maximize();
74+ tryCompare(dashAppDelegate, "visible", false);
75+ tryCompare(dialerAppDelegate, "visible", false);
76+ tryCompare(facebookAppDelegate, "visible", true);
77+
78+ // Bring dash to front. make sure dash and the maximized facebook are visible, the restored one behind is hidden
79+ ApplicationManager.focusApplication("unity8-dash");
80+ tryCompare(dashAppDelegate, "visible", true);
81+ tryCompare(dialerAppDelegate, "visible", false);
82+ tryCompare(facebookAppDelegate, "visible", true);
83+
84+ // Now focus the dialer app. all 3 should be visible again
85+ ApplicationManager.focusApplication("dialer-app");
86+ tryCompare(dashAppDelegate, "visible", true);
87+ tryCompare(dialerAppDelegate, "visible", true);
88+ tryCompare(facebookAppDelegate, "visible", true);
89+
90+ // Maximize the dialer app. The other 2 should hide
91+ dialerAppDelegate.maximize();
92+ tryCompare(dashAppDelegate, "visible", false);
93+ tryCompare(dialerAppDelegate, "visible", true);
94+ tryCompare(facebookAppDelegate, "visible", false);
95+ }
96 }
97 }
98
99=== modified file 'tests/qmltests/tst_Shell.qml'
100--- tests/qmltests/tst_Shell.qml 2015-11-24 17:44:18 +0000
101+++ tests/qmltests/tst_Shell.qml 2015-12-03 15:31:00 +0000
102@@ -1730,6 +1730,7 @@
103 tryCompare(desktopSpread, "state", "altTab")
104
105 revealLauncherByEdgePushWithMouse();
106+ tryCompare(launcher, "x", 0);
107 waitForRendering(shell)
108
109 mouseClick(bfb, bfb.width / 2, bfb.height / 2)

Subscribers

People subscribed via source and target branches