diff --git a/autotests/integration/plasma_surface_test.cpp b/autotests/integration/plasma_surface_test.cpp --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -144,17 +144,11 @@ plasmaSurface2->setRole(role); QScopedPointer shellSurface2(Test::createShellSurface(surface2.data())); QVERIFY(!shellSurface2.isNull()); - Test::render(surface2.data(), QSize(100, 50), Qt::blue); - QVERIFY(Test::waitForWaylandWindowShown()); - - QVERIFY(workspace()->activeClient() != c); - c = workspace()->activeClient(); - QEXPECT_FAIL("Desktop", "PS before WS not supported", Continue); - QEXPECT_FAIL("Panel", "PS before WS not supported", Continue); - QEXPECT_FAIL("OSD", "PS before WS not supported", Continue); - QEXPECT_FAIL("Notification", "PS before WS not supported", Continue); - QEXPECT_FAIL("ToolTip", "PS before WS not supported", Continue); - QCOMPARE(c->isOnAllDesktops(), expectedOnAllDesktops); + auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue); + QVERIFY(c2); + QVERIFY(c != c2); + + QCOMPARE(c2->isOnAllDesktops(), expectedOnAllDesktops); } void PlasmaSurfaceTest::testAcceptsFocus_data() diff --git a/wayland_server.h b/wayland_server.h --- a/wayland_server.h +++ b/wayland_server.h @@ -50,6 +50,7 @@ class SurfaceInterface; class OutputInterface; class PlasmaShellInterface; +class PlasmaShellSurfaceInterface; class PlasmaWindowManagementInterface; class QtSurfaceExtensionInterface; class OutputManagementInterface; @@ -232,6 +233,7 @@ QList m_internalClients; QHash m_clientIds; InitalizationFlags m_initFlags; + QVector m_plasmaShellSurfaces; KWIN_SINGLETON(WaylandServer) }; diff --git a/wayland_server.cpp b/wayland_server.cpp --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -130,6 +130,15 @@ ScreenLocker::KSldApp::self()->lockScreenShown(); } auto client = new ShellClient(surface); + auto it = std::find_if(m_plasmaShellSurfaces.begin(), m_plasmaShellSurfaces.end(), + [client] (PlasmaShellSurfaceInterface *surface) { + return client->surface() == surface->surface(); + } + ); + if (it != m_plasmaShellSurfaces.end()) { + client->installPlasmaShellSurface(*it); + m_plasmaShellSurfaces.erase(it); + } if (client->isInternal()) { m_internalClients << client; } else { @@ -214,6 +223,13 @@ [this] (PlasmaShellSurfaceInterface *surface) { if (ShellClient *client = findClient(surface->surface())) { client->installPlasmaShellSurface(surface); + } else { + m_plasmaShellSurfaces << surface; + connect(surface, &QObject::destroyed, this, + [this, surface] { + m_plasmaShellSurfaces.removeOne(surface); + } + ); } } );