diff options
-rw-r--r-- | src/client/qwaylandwindow.cpp | 2 | ||||
-rw-r--r-- | tests/auto/client/surface/tst_surface.cpp | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 2b7f199c..7634aedd 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -131,6 +131,8 @@ void QWaylandWindow::initWindow() Q_ASSERT(!mSubSurfaceWindow); auto *parent = static_cast<QWaylandWindow *>(QPlatformWindow::parent()); + if (!parent->mSurface) + parent->initializeWlSurface(); if (parent->wlSurface()) { if (::wl_subsurface *subsurface = mDisplay->createSubSurface(this, parent)) mSubSurfaceWindow = new QWaylandSubSurface(this, parent, subsurface); diff --git a/tests/auto/client/surface/tst_surface.cpp b/tests/auto/client/surface/tst_surface.cpp index 083bc4fa..b583390f 100644 --- a/tests/auto/client/surface/tst_surface.cpp +++ b/tests/auto/client/surface/tst_surface.cpp @@ -199,6 +199,10 @@ void tst_surface::createSubsurfaceForHiddenParent() // Make sure the client doesn't quit before it has a chance to crash xdgPingAndWaitForPong(); + + // Make sure the subsurface was actually created + const Subsurface *subsurface = exec([=] {return subSurface(0);}); + QVERIFY(subsurface); } QCOMPOSITOR_TEST_MAIN(tst_surface) |