Merge branch 'Plasma/5.9'

icc-effect-5.14.5
Martin Gräßlin 2017-02-07 22:06:57 +01:00
commit 94f8011914
3 changed files with 22 additions and 10 deletions

View File

@ -144,17 +144,11 @@ void PlasmaSurfaceTest::testRoleOnAllDesktops()
plasmaSurface2->setRole(role);
QScopedPointer<ShellSurface> shellSurface2(Test::createShellSurface(surface2.data()));
QVERIFY(!shellSurface2.isNull());
Test::render(surface2.data(), QSize(100, 50), Qt::blue);
QVERIFY(Test::waitForWaylandWindowShown());
auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(100, 50), Qt::blue);
QVERIFY(c2);
QVERIFY(c != c2);
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);
QCOMPARE(c2->isOnAllDesktops(), expectedOnAllDesktops);
}
void PlasmaSurfaceTest::testAcceptsFocus_data()

View File

@ -130,6 +130,15 @@ void WaylandServer::createSurface(T *surface)
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 @@ bool WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags)
[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);
}
);
}
}
);

View File

@ -50,6 +50,7 @@ class ServerSideDecorationManagerInterface;
class SurfaceInterface;
class OutputInterface;
class PlasmaShellInterface;
class PlasmaShellSurfaceInterface;
class PlasmaWindowManagementInterface;
class QtSurfaceExtensionInterface;
class OutputManagementInterface;
@ -232,6 +233,7 @@ private:
QList<ShellClient*> m_internalClients;
QHash<KWayland::Server::ClientConnection*, quint16> m_clientIds;
InitalizationFlags m_initFlags;
QVector<KWayland::Server::PlasmaShellSurfaceInterface*> m_plasmaShellSurfaces;
KWIN_SINGLETON(WaylandServer)
};