From 5cfe9428aa6c8b7828f1506eba82daa8427e2fae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 17 Dec 2015 15:32:41 +0100 Subject: [PATCH] [backends/wayland] Use server side decorations if available --- backends/wayland/wayland_backend.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backends/wayland/wayland_backend.cpp b/backends/wayland/wayland_backend.cpp index 430f630073..5b4dfeee19 100644 --- a/backends/wayland/wayland_backend.cpp +++ b/backends/wayland/wayland_backend.cpp @@ -40,6 +40,7 @@ along with this program. If not, see . #include #include #include +#include #include #include #include @@ -424,6 +425,19 @@ void WaylandBackend::createSurface() qCCritical(KWIN_WAYLAND_BACKEND) << "Creating Wayland Surface failed"; return; } + using namespace KWayland::Client; + auto iface = m_registry->interface(Registry::Interface::ServerSideDecorationManager); + if (iface.name != 0) { + auto manager = m_registry->createServerSideDecorationManager(iface.name, iface.version, this); + auto decoration = manager->create(m_surface, this); + connect(decoration, &ServerSideDecoration::modeChanged, this, + [this, decoration] { + if (decoration->mode() != ServerSideDecoration::Mode::Server) { + decoration->requestMode(ServerSideDecoration::Mode::Server); + } + } + ); + } if (m_seat) { m_seat->setInstallCursor(true); }