Merge lp:~gerboland/qtmir/initial-surface-expose into lp:qtmir

Proposed by Gerry Boland
Status: Merged
Approved by: Nick Dedekind
Approved revision: 584
Merged at revision: 587
Proposed branch: lp:~gerboland/qtmir/initial-surface-expose
Merge into: lp:qtmir
Diff against target: 59 lines (+31/-0)
2 files modified
src/modules/Unity/Application/mirsurface.cpp (+1/-0)
tests/modules/WindowManager/mirsurface_test.cpp (+30/-0)
To merge this branch: bzr merge lp:~gerboland/qtmir/initial-surface-expose
Reviewer Review Type Date Requested Status
Nick Dedekind (community) Approve
Unity8 CI Bot (community) continuous-integration Approve
Review via email: mp+314458@code.launchpad.net

Commit message

Recalculate MirSurface.visible after first frame swap by client

Fixes issue where OSK would be invisible at startup

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:584
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/442/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3751
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3779
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3623/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3623
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3623/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

All good here.
Test fails before, passes after.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
--- src/modules/Unity/Application/mirsurface.cpp 2016-11-25 15:23:36 +0000
+++ src/modules/Unity/Application/mirsurface.cpp 2017-01-10 18:01:14 +0000
@@ -845,6 +845,7 @@
845 if (!m_ready) {845 if (!m_ready) {
846 DEBUG_MSG << "()";846 DEBUG_MSG << "()";
847 m_ready = true;847 m_ready = true;
848 updateVisible(); // as Mir can change m_surface->visible() to true after first frame swap
848 Q_EMIT ready();849 Q_EMIT ready();
849 updateExposure();850 updateExposure();
850 }851 }
851852
=== modified file 'tests/modules/WindowManager/mirsurface_test.cpp'
--- tests/modules/WindowManager/mirsurface_test.cpp 2016-11-03 20:17:46 +0000
+++ tests/modules/WindowManager/mirsurface_test.cpp 2017-01-10 18:01:14 +0000
@@ -61,6 +61,8 @@
61struct MockSurface : public StubSurface61struct MockSurface : public StubSurface
62{62{
63 MOCK_CONST_METHOD1(buffers_ready_for_compositor, int(void const*));63 MOCK_CONST_METHOD1(buffers_ready_for_compositor, int(void const*));
64 MOCK_CONST_METHOD0(visible, bool());
65 MOCK_CONST_METHOD0(state, MirSurfaceState());
64};66};
6567
66class MirSurfaceTest : public ::testing::Test68class MirSurfaceTest : public ::testing::Test
@@ -159,6 +161,34 @@
159}161}
160162
161/*163/*
164 * Test that MirSurface.visible is recalculated after the client swaps the first frame.
165 * A surface is not considered visible unless it has a non-hidden & non-minimized state, and
166 * it has drawn at least one frame.
167 */
168TEST_F(MirSurfaceTest, EnsureVisiblePropertyRecalculatedAfterFrameSwap)
169{
170 auto mockSurface = std::make_shared<NiceMock<MockSurface>>();
171 miral::Window mockWindow(stubSession, mockSurface);
172 ms::SurfaceCreationParameters spec;
173 miral::WindowInfo mockWindowInfo(mockWindow, spec);
174
175 EXPECT_CALL(*mockSurface.get(),state())
176 .WillRepeatedly(Return(mir_surface_state_maximized));
177 EXPECT_CALL(*mockSurface.get(),visible())
178 .WillOnce(Return(false));
179
180 MirSurface surface(mockWindowInfo, nullptr);
181
182 EXPECT_FALSE(surface.visible());
183
184 EXPECT_CALL(*mockSurface.get(),visible())
185 .WillOnce(Return(true));
186
187 surface.setReady();
188 EXPECT_TRUE(surface.visible());
189}
190
191/*
162 * Test that a surface whose client fails to comply with a close request will eventually comply.192 * Test that a surface whose client fails to comply with a close request will eventually comply.
163 */193 */
164struct MockWindowModelController : public StubWindowModelController194struct MockWindowModelController : public StubWindowModelController

Subscribers

People subscribed via source and target branches