[backends/wayland] Use server side decorations if available
This commit is contained in:
parent
5cef26d275
commit
5cfe9428aa
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue