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
=== modified file 'qml/Stages/DesktopStage.qml'
--- qml/Stages/DesktopStage.qml 2015-11-30 17:27:47 +0000
+++ qml/Stages/DesktopStage.qml 2016-01-08 13:29:28 +0000
@@ -124,16 +124,20 @@
124 onFocusedAppDelegateChanged: updateForegroundMaximizedApp();124 onFocusedAppDelegateChanged: updateForegroundMaximizedApp();
125125
126 property int foregroundMaximizedAppZ: -1126 property int foregroundMaximizedAppZ: -1
127 property int foregroundMaximizedAppIndex: -1 // for stuff like drop shadow and focusing maximized app by clicking panel
127128
128 function updateForegroundMaximizedApp() {129 function updateForegroundMaximizedApp() {
129 var tmp = -1;130 var tmp = -1;
131 var tmpAppId = -1;
130 for (var i = appRepeater.count - 1; i >= 0; i--) {132 for (var i = appRepeater.count - 1; i >= 0; i--) {
131 var item = appRepeater.itemAt(i);133 var item = appRepeater.itemAt(i);
132 if (item && item.visuallyMaximized) {134 if (item && item.visuallyMaximized) {
135 tmpAppId = i;
133 tmp = Math.max(tmp, item.normalZ);136 tmp = Math.max(tmp, item.normalZ);
134 }137 }
135 }138 }
136 foregroundMaximizedAppZ = tmp;139 foregroundMaximizedAppZ = tmp;
140 foregroundMaximizedAppIndex = tmpAppId;
137 }141 }
138142
139 function indexOf(appId) {143 function indexOf(appId) {
@@ -176,8 +180,8 @@
176 onMinimize: priv.focusedAppDelegate && priv.focusedAppDelegate.minimize();180 onMinimize: priv.focusedAppDelegate && priv.focusedAppDelegate.minimize();
177 onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel181 onMaximize: priv.focusedAppDelegate // don't restore minimized apps when double clicking the panel
178 && priv.focusedAppDelegate.restoreFromMaximized();182 && priv.focusedAppDelegate.restoreFromMaximized();
179 onFocusMaximizedApp: if (priv.foregroundMaximizedAppIdIndex != -1) {183 onFocusMaximizedApp: if (priv.foregroundMaximizedAppIndex != -1) {
180 ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIdIndex).appId);184 ApplicationManager.focusApplication(appRepeater.itemAt(priv.foregroundMaximizedAppIndex).appId);
181 }185 }
182 }186 }
183187
@@ -206,7 +210,7 @@
206 Binding {210 Binding {
207 target: PanelState211 target: PanelState
208 property: "dropShadow"212 property: "dropShadow"
209 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppIdIndex !== -1213 value: priv.focusedAppDelegate && !priv.focusedAppDelegate.maximized && priv.foregroundMaximizedAppIndex !== -1
210 }214 }
211215
212 Component.onDestruction: {216 Component.onDestruction: {
213217
=== modified file 'tests/qmltests/Stages/tst_DesktopStage.qml'
--- tests/qmltests/Stages/tst_DesktopStage.qml 2015-12-08 15:37:51 +0000
+++ tests/qmltests/Stages/tst_DesktopStage.qml 2016-01-08 13:29:28 +0000
@@ -25,6 +25,7 @@
25import ".." // For EdgeBarrierControls25import ".." // For EdgeBarrierControls
26import "../../../qml/Stages"26import "../../../qml/Stages"
27import "../../../qml/Components"27import "../../../qml/Components"
28import "../../../qml/Components/PanelState"
2829
29Item {30Item {
30 id: root31 id: root
@@ -500,5 +501,33 @@
500 tryCompare(dialerAppDelegate, "visible", true);501 tryCompare(dialerAppDelegate, "visible", true);
501 tryCompare(facebookAppDelegate, "visible", false);502 tryCompare(facebookAppDelegate, "visible", false);
502 }503 }
504
505 function test_dropShadow() {
506 killAllRunningApps();
507
508 // verify the drop shadow is not visible initially
509 verify(PanelState.dropShadow == false);
510
511 // start an app, maximize it
512 var facebookApp = startApplication("facebook-webapp");
513 var facebookAppDelegate = findChild(desktopStage, "appDelegate_facebook-webapp");
514 facebookAppDelegate.maximize();
515
516 // verify the drop shadow is still not visible
517 verify(PanelState.dropShadow == false);
518
519 // start a foreground app, not maximized
520 var dialerApp = startApplication("dialer-app");
521 var dialerAppDelegate = findChild(desktopStage, "appDelegate_dialer-app");
522
523 // verify the drop shadow becomes visible
524 verify(PanelState.dropShadow == true);
525
526 // close the maximized app
527 ApplicationManager.stopApplication("facebook-webapp");
528
529 // verify the drop shadow is gone
530 verify(PanelState.dropShadow == false);
531 }
503 }532 }
504}533}

Subscribers

People subscribed via source and target branches