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

Proposed by Lukáš Tinkl
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2110
Merged at revision: 2130
Proposed branch: lp:~lukas-kde/unity8/fixPanelMaxState
Merge into: lp:unity8
Diff against target: 90 lines (+36/-3)
2 files modified
qml/Stages/DesktopStage.qml (+7/-3)
tests/qmltests/Stages/tst_DesktopStage.qml (+29/-0)
To merge this branch: bzr merge lp:~lukas-kde/unity8/fixPanelMaxState
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Michael Zanetti (community) Approve
Review via email: mp+281856@code.launchpad.net

Commit message

Fix panel drop shadow and click-to-focus of maximized apps

Description of the change

Fix recent desktop stage regressions:

1. the panel drop shadow is always displayed (should only be visible when there's a maximized app in background)
2. with a max'd app in background, clicking the panel no longer brings that app into foreground

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

No

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

Yes

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

Yes

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

Yes

* If you changed the UI, has there been a design review?

Yes (this is to align with the intended design)

To post a comment you must log in.
2109. By Lukáš Tinkl

add a regression test for the drop shadow stuff

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

Added a regression test for the drop shadow stuff

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

FAILED: Continuous integration, rev:2108
http://jenkins.qa.ubuntu.com/job/unity8-ci/7027/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5960
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/442/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1732
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/435
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1627
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1627
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/434
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/433
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4607
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5971
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5971/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26473
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/194/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/440
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/440/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26474

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

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2109
http://jenkins.qa.ubuntu.com/job/unity8-ci/7029/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5967
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/444/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1734
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/437
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1629
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1629
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/436
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/435
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4612
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5978
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5978/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26483
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/196/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/442
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/442/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26482

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

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

It fixes the interaction with the panel, so that's good. Two remarks:

====

+ property int foregroundMaximizedAppIdIndex: -1

I know this has been there before, but please rename it to foregroundMaximizedAppId, as it has nothing to do with an index.

====

it fixes the issue, but there is something wrong with the dropshadow still. If there is a maximized app, but not in foreground, the panel's dropshadow is visible. However, comparing that with unity7, the dropshadow seems to be *always* behind any window. It effectively only drops a shadow onto the wallpaper.

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

> It fixes the interaction with the panel, so that's good. Two remarks:
>
> ====
>
> + property int foregroundMaximizedAppIdIndex: -1
>
> I know this has been there before, but please rename it to
> foregroundMaximizedAppId, as it has nothing to do with an index.

Shouldn't it rather be foregroundMaximizedAppIndex? It is an index in fact, it has nothing to do with "appId" in fact.

>
> it fixes the issue, but there is something wrong with the dropshadow still. If
> there is a maximized app, but not in foreground, the panel's dropshadow is
> visible. However, comparing that with unity7, the dropshadow seems to be
> *always* behind any window. It effectively only drops a shadow onto the
> wallpaper.

I believe that's the correct behavior, the drop shadow should be visible only if there's a maximized app in the background (https://docs.google.com/presentation/d/1O9B6d4gm3X_u7460o_iTYORTWJ7Td7aN7jLvo2O9A4w/edit?hl=en#slide=id.ge5d9cfc49_0_17)

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

On 08.01.2016 12:37, Lukáš Tinkl wrote:
>> It fixes the interaction with the panel, so that's good. Two remarks:
>>
>> ====
>>
>> + property int foregroundMaximizedAppIdIndex: -1
>>
>> I know this has been there before, but please rename it to
>> foregroundMaximizedAppId, as it has nothing to do with an index.
>
> Shouldn't it rather be foregroundMaximizedAppIndex? It is an index in fact, it has nothing to do with "appId" in fact.

ok, if it is an index, fine. but the current mix of IdIndex is broken in
any case :)

>
>>
>> it fixes the issue, but there is something wrong with the dropshadow still. If
>> there is a maximized app, but not in foreground, the panel's dropshadow is
>> visible. However, comparing that with unity7, the dropshadow seems to be
>> *always* behind any window. It effectively only drops a shadow onto the
>> wallpaper.
>
> I believe that's the correct behavior, the drop shadow should be visible only if there's a maximized app in the background (https://docs.google.com/presentation/d/1O9B6d4gm3X_u7460o_iTYORTWJ7Td7aN7jLvo2O9A4w/edit?hl=en#slide=id.ge5d9cfc49_0_17)
>

ok then. wfm, just wanted to be sure this is what's wanted.

2110. By Lukáš Tinkl

rename internal variable to foregroundMaximizedAppIndex

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

>
>
> On 08.01.2016 12:37, Lukáš Tinkl wrote:
> >> It fixes the interaction with the panel, so that's good. Two remarks:
> >>
> >> ====
> >>
> >> + property int foregroundMaximizedAppIdIndex: -1
> >>
> >> I know this has been there before, but please rename it to
> >> foregroundMaximizedAppId, as it has nothing to do with an index.
> >
> > Shouldn't it rather be foregroundMaximizedAppIndex? It is an index in fact,
> it has nothing to do with "appId" in fact.
>
> ok, if it is an index, fine. but the current mix of IdIndex is broken in
> any case :)

Done

Revision history for this message
Michael Zanetti (mzanetti) 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.

unrelated failures, no new regressions from this branch

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

yes, stripped now

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

FAILED: Continuous integration, rev:2110
http://jenkins.qa.ubuntu.com/job/unity8-ci/7034/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5974
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/449/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1739
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/442
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1634
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1634
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/441
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/440
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4618
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5985
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5985/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26510
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/199/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/447
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/447/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/26511

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/7034/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/DesktopStage.qml'
2--- qml/Stages/DesktopStage.qml 2015-11-30 17:27:47 +0000
3+++ qml/Stages/DesktopStage.qml 2016-01-08 13:29:28 +0000
4@@ -124,16 +124,20 @@
5 onFocusedAppDelegateChanged: updateForegroundMaximizedApp();
6
7 property int foregroundMaximizedAppZ: -1
8+ property int foregroundMaximizedAppIndex: -1 // for stuff like drop shadow and focusing maximized app by clicking panel
9
10 function updateForegroundMaximizedApp() {
11 var tmp = -1;
12+ var tmpAppId = -1;
13 for (var i = appRepeater.count - 1; i >= 0; i--) {
14 var item = appRepeater.itemAt(i);
15 if (item && item.visuallyMaximized) {
16+ tmpAppId = i;
17 tmp = Math.max(tmp, item.normalZ);
18 }
19 }
20 foregroundMaximizedAppZ = tmp;
21+ foregroundMaximizedAppIndex = tmpAppId;
22 }
23
24 function indexOf(appId) {
25@@ -176,8 +180,8 @@
26 onMinimize: priv.focusedAppDelegate && priv.focusedAppDelegate.minimize();
27 onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel
28 && priv.focusedAppDelegate.restoreFromMaximized();
29- onFocusMaximizedApp: if (priv.foregroundMaximizedAppIdIndex != -1) {
30- ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIdIndex).appId);
31+ onFocusMaximizedApp: if (priv.foregroundMaximizedAppIndex != -1) {
32+ ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIndex).appId);
33 }
34 }
35
36@@ -206,7 +210,7 @@
37 Binding {
38 target: PanelState
39 property: "dropShadow"
40- value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppIdIndex !== -1
41+ value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppIndex !== -1
42 }
43
44 Component.onDestruction: {
45
46=== modified file 'tests/qmltests/Stages/tst_DesktopStage.qml'
47--- tests/qmltests/Stages/tst_DesktopStage.qml 2015-12-08 15:37:51 +0000
48+++ tests/qmltests/Stages/tst_DesktopStage.qml 2016-01-08 13:29:28 +0000
49@@ -25,6 +25,7 @@
50 import ".." // For EdgeBarrierControls
51 import "../../../qml/Stages"
52 import "../../../qml/Components"
53+import "../../../qml/Components/PanelState"
54
55 Item {
56 id: root
57@@ -500,5 +501,33 @@
58 tryCompare(dialerAppDelegate, "visible", true);
59 tryCompare(facebookAppDelegate, "visible", false);
60 }
61+
62+ function test_dropShadow() {
63+ killAllRunningApps();
64+
65+ // verify the drop shadow is not visible initially
66+ verify(PanelState.dropShadow == false);
67+
68+ // start an app, maximize it
69+ var facebookApp = startApplication("facebook-webapp");
70+ var facebookAppDelegate = findChild(desktopStage, "appDelegate_facebook-webapp");
71+ facebookAppDelegate.maximize();
72+
73+ // verify the drop shadow is still not visible
74+ verify(PanelState.dropShadow == false);
75+
76+ // start a foreground app, not maximized
77+ var dialerApp = startApplication("dialer-app");
78+ var dialerAppDelegate = findChild(desktopStage, "appDelegate_dialer-app");
79+
80+ // verify the drop shadow becomes visible
81+ verify(PanelState.dropShadow == true);
82+
83+ // close the maximized app
84+ ApplicationManager.stopApplication("facebook-webapp");
85+
86+ // verify the drop shadow is gone
87+ verify(PanelState.dropShadow == false);
88+ }
89 }
90 }

Subscribers

People subscribed via source and target branches