[backends/wayland] Use server side decorations if available
parent
5cef26d275
commit
5cfe9428aa
|
@ -40,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#include <KWayland/Client/region.h>
|
#include <KWayland/Client/region.h>
|
||||||
#include <KWayland/Client/registry.h>
|
#include <KWayland/Client/registry.h>
|
||||||
#include <KWayland/Client/seat.h>
|
#include <KWayland/Client/seat.h>
|
||||||
|
#include <KWayland/Client/server_decoration.h>
|
||||||
#include <KWayland/Client/shell.h>
|
#include <KWayland/Client/shell.h>
|
||||||
#include <KWayland/Client/shm_pool.h>
|
#include <KWayland/Client/shm_pool.h>
|
||||||
#include <KWayland/Client/surface.h>
|
#include <KWayland/Client/surface.h>
|
||||||
|
@ -424,6 +425,19 @@ void WaylandBackend::createSurface()
|
||||||
qCCritical(KWIN_WAYLAND_BACKEND) << "Creating Wayland Surface failed";
|
qCCritical(KWIN_WAYLAND_BACKEND) << "Creating Wayland Surface failed";
|
||||||
return;
|
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) {
|
if (m_seat) {
|
||||||
m_seat->setInstallCursor(true);
|
m_seat->setInstallCursor(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue