Merge lp:~gerboland/unity8/fix-osk-restart-reconnecting into lp:unity8

Proposed by Gerry Boland
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 2841
Merged at revision: 2842
Proposed branch: lp:~gerboland/unity8/fix-osk-restart-reconnecting
Merge into: lp:unity8
Diff against target: 11 lines (+1/-0)
1 file modified
plugins/WindowManager/TopLevelWindowModel.cpp (+1/-0)
To merge this branch: bzr merge lp:~gerboland/unity8/fix-osk-restart-reconnecting
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+319204@code.launchpad.net

Commit message

TopLevelWindowModel: connect to the OSK surface to know when it goes away so we can clean up after it.

This ensures when setLive(false) is called on the OSK surface, onSurfaceDied is called which will unset it as the internal input method surface.

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

Are there tests for TLWM? I couldn't find any

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

> Are there tests for TLWM?

TopLevelWindowModel? No.

Revision history for this message
Gerry Boland (gerboland) wrote :

I'd appreciate guidance on how to test this then.

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

PASSED: Continuous integration, rev:2841
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3298/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/4340
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2596
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2596
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/4368
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4202
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/4202/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4202
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/4202/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4202
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/4202/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4202
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/4202/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4202
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/4202/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4202
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/4202/artifact/output/*zip*/output.zip

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

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

> I'd appreciate guidance on how to test this then.

1 - You feed it a fake ApplicationManager and a fake SurfaceManager.
2 - check that TopLevelWindowModel::inputMethodSurface() returns null
3 - Emit SurfaceManager::surfaceCreated with a fake MirSurface of type Mir::InputMethodType
4 - check that TopLevelWindowModel::inputMethodSurfaceChanged is emitted and that TopLevelWindowModel::inputMethodSurface() returns the afore mentioned surface
5 - Call setLive(false) on your fake input method MirSurface
6 - check that TopLevelWindowModel::inputMethodSurfaceChanged is emitted and that TopLevelWindowModel::inputMethodSurface() returns null

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

test is sugar on top

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/WindowManager/TopLevelWindowModel.cpp'
2--- plugins/WindowManager/TopLevelWindowModel.cpp 2017-01-26 11:10:01 +0000
3+++ plugins/WindowManager/TopLevelWindowModel.cpp 2017-03-07 13:43:08 +0000
4@@ -341,6 +341,7 @@
5 });
6 } else {
7 if (surface->type() == Mir::InputMethodType) {
8+ connectSurface(surface);
9 setInputMethodWindow(createWindow(surface));
10 } else {
11 auto *application = m_applicationManager->findApplicationWithSurface(surface);

Subscribers

People subscribed via source and target branches