Commit 5cfe9428 authored by Martin Flöser's avatar Martin Flöser

[backends/wayland] Use server side decorations if available

parent 5cef26d2
......@@ -40,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/region.h>
#include <KWayland/Client/registry.h>
#include <KWayland/Client/seat.h>
#include <KWayland/Client/server_decoration.h>
#include <KWayland/Client/shell.h>
#include <KWayland/Client/shm_pool.h>
#include <KWayland/Client/surface.h>
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment