From 8b6fef457b4fc8895c485106d4c6c134252936e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 20 Jun 2015 02:48:48 +0200 Subject: [PATCH] [wayland] Export themed icon name to PlasmaWindow interface If the icon doesn't have a name, we pass the generic xorg icon. Most likely our xwayland clients won't have a theme name, so giving them the xorg icon seems a good enough work around. If we would want to pass the real icon for xwayland clients we would need a way to serialize them which seems like quite some needless overhead for legacy applications. Can be considered for the future nevertheless. --- wayland_server.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wayland_server.cpp b/wayland_server.cpp index 6015766a09..35fed2e5ae 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -227,6 +227,7 @@ void WaylandServer::announceClientToWindowManagement(AbstractClient *c) w->setMaximizeable(c->isMaximizable()); w->setMinimizeable(c->isMinimizable()); w->setFullscreenable(c->isFullScreenable()); + w->setThemedIconName(c->icon().name().isEmpty() ? QStringLiteral("xorg") : c->icon().name()); connect(c, &AbstractClient::captionChanged, w, [w, c] { w->setTitle(c->caption()); }); connect(c, &AbstractClient::desktopChanged, w, [w, c] { @@ -250,6 +251,12 @@ void WaylandServer::announceClientToWindowManagement(AbstractClient *c) } ); connect(c, &AbstractClient::demandsAttentionChanged, w, [w, c] { w->setDemandsAttention(c->isDemandingAttention()); }); + connect(c, &AbstractClient::iconChanged, w, + [w, c] { + const QIcon icon = c->icon(); + w->setThemedIconName(icon.name().isEmpty() ? QStringLiteral("xorg") : icon.name()); + } + ); connect(c, &QObject::destroyed, w, &KWayland::Server::PlasmaWindowInterface::unmap); connect(w, &PlasmaWindowInterface::closeRequested, c, [c] { c->closeWindow(); }); connect(w, &PlasmaWindowInterface::virtualDesktopRequested, c,