Merge lp:~mzanetti/unity8/no-displace-when-external into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Sawicz
Approved revision: 2529
Merged at revision: 2529
Proposed branch: lp:~mzanetti/unity8/no-displace-when-external
Merge into: lp:unity8
Diff against target: 63 lines (+12/-4)
4 files modified
qml/Shell.qml (+5/-0)
qml/Stages/AbstractStage.qml (+1/-0)
qml/Stages/DesktopStage.qml (+1/-1)
tests/qmltests/Stages/tst_DesktopStage.qml (+5/-3)
To merge this branch: bzr merge lp:~mzanetti/unity8/no-displace-when-external
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Needs Fixing
Michał Sawicz Approve
Review via email: mp+299126@code.launchpad.net

Commit message

don't displace windows if the OSK is on another screen

Description of the change

* No related branches

* Tested on frieza

* no change that requires design review

* no packaging change

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :

Lookin' good.

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

FWIW: the AbstractStage.visibleRect (or just oskRect, for simplicity) approach would have that covered and at the same time improve modularity by avoiding DesktopStage fiddling with SurfaceManager.inputMethodSurface and UbuntuKeyboardInfo, which is really of interest only to InputMethod.qml.

As this bug shows, DesktopStage doesn't want to know about SurfaceManager.inputMethodSurface or UbuntuKeyboardInfo (handling those is the job of InputMethod), it wants to know about the InputMethod component state, which is what actually gets displayed in from of DesktopStage.

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

FAILED: Continuous integration, rev:2529
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1668/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/2213
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1178/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1178/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1178
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/2241
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/2147
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/2147
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/2147
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2138/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2138
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2138/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1668/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/Shell.qml'
2--- qml/Shell.qml 2016-06-20 16:25:15 +0000
3+++ qml/Shell.qml 2016-07-05 09:58:40 +0000
4@@ -387,6 +387,11 @@
5 property: "topLevelSurfaceList"
6 value: topLevelSurfaceList
7 }
8+ Binding {
9+ target: applicationsDisplayLoader.item
10+ property: "oskEnabled"
11+ value: shell.oskEnabled
12+ }
13 }
14 }
15
16
17=== modified file 'qml/Stages/AbstractStage.qml'
18--- qml/Stages/AbstractStage.qml 2016-05-26 11:17:55 +0000
19+++ qml/Stages/AbstractStage.qml 2016-07-05 09:58:40 +0000
20@@ -43,6 +43,7 @@
21 // A Stage should paint a wallpaper etc over its full size but not use the margins for window placement
22 property int leftMargin: 0
23 property alias paintBackground: background.visible
24+ property bool oskEnabled: false
25
26 // To be read from outside
27 property var mainApp: null
28
29=== modified file 'qml/Stages/DesktopStage.qml'
30--- qml/Stages/DesktopStage.qml 2016-06-27 18:44:07 +0000
31+++ qml/Stages/DesktopStage.qml 2016-07-05 09:58:40 +0000
32@@ -274,7 +274,7 @@
33 value: appDelegate.requestedY -
34 Math.min(appDelegate.requestedY - PanelState.panelHeight,
35 Math.max(0, UbuntuKeyboardInfo.height - (appContainer.height - (appDelegate.requestedY + appDelegate.height))))
36- when: appDelegate.focus && appDelegate.state == "normal"
37+ when: root.oskEnabled && appDelegate.focus && appDelegate.state == "normal"
38 && SurfaceManager.inputMethodSurface
39 && SurfaceManager.inputMethodSurface.state != Mir.HiddenState
40 && SurfaceManager.inputMethodSurface.state != Mir.MinimizedState
41
42=== modified file 'tests/qmltests/Stages/tst_DesktopStage.qml'
43--- tests/qmltests/Stages/tst_DesktopStage.qml 2016-06-27 18:44:07 +0000
44+++ tests/qmltests/Stages/tst_DesktopStage.qml 2016-07-05 09:58:40 +0000
45@@ -519,13 +519,15 @@
46
47 function test_oskDisplacesWindow_data() {
48 return [
49- {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5)},
50- {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight},
51- {tag: "displace a bit", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: (root.height / 2) - units.gu(40)},
52+ {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
53+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight, oskEnabled: true},
54+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: PanelState.panelHeight, oskEnabled: true},
55+ {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
56 ]
57 }
58
59 function test_oskDisplacesWindow(data) {
60+ desktopStageLoader.item.oskEnabled = data.oskEnabled
61 var dashAppDelegate = startApplication("unity8-dash");
62 var oldOSKState = SurfaceManager.inputMethodSurface.state;
63 SurfaceManager.inputMethodSurface.state = Mir.RestoredState;

Subscribers

People subscribed via source and target branches