Merge lp:~lukas-kde/unity8/occlusion-transparency into lp:unity8

Proposed by Lukáš Tinkl
Status: Work in progress
Proposed branch: lp:~lukas-kde/unity8/occlusion-transparency
Merge into: lp:unity8
Diff against target: 81 lines (+12/-1)
4 files modified
qml/Stage/ApplicationWindow.qml (+1/-0)
qml/Stage/DecoratedWindow.qml (+1/-0)
qml/Stage/Stage.qml (+7/-1)
qml/Stage/SurfaceContainer.qml (+3/-0)
To merge this branch: bzr merge lp:~lukas-kde/unity8/occlusion-transparency
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Gerry Boland (community) Needs Fixing
Michael Zanetti (community) Needs Fixing
Review via email: mp+317769@code.launchpad.net

Commit message

Don't hide windows that are behind a maximized one

Description of the change

Don't hide windows that are behind a maximized one

Fixes issues with transparent apps, such as the new terminal (lp:1666170)

* 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

* 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
Michael Zanetti (mzanetti) wrote :

As discussed on IRC, we should only do this for apps that have requested a transparent surface.

This, however, requires QtMir to pass that info on to the shell still.

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

FAILED: Continuous integration, rev:2809
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3156/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4138
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2428
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2428
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4166
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4006
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4006/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4006
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4006/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4006
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4006/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4006
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4006/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4006
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4006/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4006
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4006/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

surfaceItem.opacity === 1.0

This is the MirSurfaceItem/QQuickItem::opacity property you're reading, which is a renderer-only hint.

MirSurfaceItem will expose a boolean "surfaceOpaque" property that will actually tell you if the frame the client draws uses transparency or not.

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

> surfaceItem.opacity === 1.0
>
> This is the MirSurfaceItem/QQuickItem::opacity property you're reading, which
> is a renderer-only hint.
>
> MirSurfaceItem will expose a boolean "surfaceOpaque" property that will
> actually tell you if the frame the client draws uses transparency or not.

Ok, that's indeed more correct; let's wait for that

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

FAILED: Continuous integration, rev:2810
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3164/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4153
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2439
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2439
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4181
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4019
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4019/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4019
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4019/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4019
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4019/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4019
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4019/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4019
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4019/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4019
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4019/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The function you want is possibly "mir::graphics::Renderable::shaped()", which tells you if it is something other than an opaque rectangle.

Unmerged revisions

2810. By Lukáš Tinkl

take opacity into account when calculating occlusion

2809. By Lukáš Tinkl

don't occlude delegates behind a maximized window

this can't work with transparent windows

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Stage/ApplicationWindow.qml'
2--- qml/Stage/ApplicationWindow.qml 2016-09-22 14:17:39 +0000
3+++ qml/Stage/ApplicationWindow.qml 2017-02-21 13:57:20 +0000
4@@ -28,6 +28,7 @@
5 property bool orientationChangesEnabled: d.supportsSurfaceResize ? d.surfaceOldEnoughToBeResized : true
6 readonly property string title: surface && surface.name !== "" ? surface.name : d.name
7 readonly property QtObject focusedSurface: d.focusedSurface.surface
8+ readonly property bool isFullyOpaque: d.focusedSurface.isFullyOpaque
9
10 // to be set from outside
11 property QtObject surface
12
13=== modified file 'qml/Stage/DecoratedWindow.qml'
14--- qml/Stage/DecoratedWindow.qml 2017-01-26 11:10:01 +0000
15+++ qml/Stage/DecoratedWindow.qml 2017-02-21 13:57:20 +0000
16@@ -38,6 +38,7 @@
17 property alias maximizeButtonShown: decoration.maximizeButtonShown
18 property alias interactive: applicationWindow.interactive
19 readonly property alias orientationChangesEnabled: applicationWindow.orientationChangesEnabled
20+ readonly property alias isFullyOpaque: applicationWindow.isFullyOpaque
21
22 // Changing this will actually add/remove a decoration, meaning, requestedHeight will take the decoration into account.
23 property bool hasDecoration: true
24
25=== modified file 'qml/Stage/Stage.qml'
26--- qml/Stage/Stage.qml 2017-02-16 13:44:45 +0000
27+++ qml/Stage/Stage.qml 2017-02-21 13:57:20 +0000
28@@ -347,6 +347,8 @@
29 }
30
31 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
32+
33+ property bool anyWindowAnimating: false
34 }
35
36 Component.onCompleted: priv.updateMainAndSideStageIndexes();
37@@ -825,6 +827,7 @@
38 readonly property bool canBeMaximizedHorizontally: maximumWidth == 0 || maximumWidth >= appContainer.width
39 readonly property bool canBeMaximizedVertically: maximumHeight == 0 || maximumHeight >= appContainer.height
40 readonly property alias orientationChangesEnabled: decoratedWindow.orientationChangesEnabled
41+ readonly property alias isFullyOpaque: decoratedWindow.isFullyOpaque
42
43 // TODO drop our own windowType once Mir/Miral/Qtmir gets in sync with ours
44 property int windowState: WindowStateStorage.WindowStateNormal
45@@ -993,6 +996,8 @@
46 )
47 || appDelegate.fullscreen
48 || focusAnimation.running || rightEdgeFocusAnimation.running || hidingAnimation.running
49+ || priv.anyWindowAnimating // bug #1666363
50+ || (priv.foregroundMaximizedAppDelegate && !priv.foregroundMaximizedAppDelegate.isFullyOpaque) // bug #1666170
51
52 function close() {
53 model.window.close();
54@@ -1530,11 +1535,12 @@
55 to: ",normal,restored,maximized,maximizedLeft,maximizedRight,maximizedTopLeft,maximizedTopRight,maximizedBottomLeft,maximizedBottomRight,maximizedHorizontally,maximizedVertically,fullscreen"
56 enabled: appDelegate.animationsEnabled
57 SequentialAnimation {
58+ ScriptAction { script: { priv.anyWindowAnimating = true; } }
59 PropertyAction { target: appDelegate; property: "visuallyMinimized" }
60 UbuntuNumberAnimation { target: appDelegate; properties: "requestedX,requestedY,windowedX,windowedY,opacity,scale,requestedWidth,requestedHeight,windowedWidth,windowedHeight";
61 duration: priv.animationDuration }
62 PropertyAction { target: appDelegate; property: "visuallyMaximized" }
63- ScriptAction { script: { fakeRectangle.stop(); } }
64+ ScriptAction { script: { fakeRectangle.stop(); priv.anyWindowAnimating = false; } }
65 }
66 }
67 ]
68
69=== modified file 'qml/Stage/SurfaceContainer.qml'
70--- qml/Stage/SurfaceContainer.qml 2016-09-22 13:35:35 +0000
71+++ qml/Stage/SurfaceContainer.qml 2017-02-21 13:57:20 +0000
72@@ -39,6 +39,9 @@
73 // to update surface activeFocus. See mock MirSurfaceItem.
74 property alias consumesInput: surfaceItem.consumesInput
75
76+ // read from outside
77+ readonly property bool isFullyOpaque: surface ? surfaceItem.opacity === 1.0 : true
78+
79 onSurfaceChanged: {
80 // Not a binding because animations might remove the surface from the surfaceItem
81 // programatically (in order to signal that a zombie surface is free for deletion),

Subscribers

People subscribed via source and target branches