From 54c2c5db2d0ea648f3e934cebd5628da894bd5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 25 Feb 2015 09:35:42 +0100 Subject: [PATCH] [wayland] Create SeatInterface and sync with WaylandBackend's seat If not using libinput we get the seat information from the lower level Wayland server: let's forward the information to our own SeatInterface. --- wayland_backend.cpp | 11 +++++++++++ wayland_server.cpp | 3 +++ 2 files changed, 14 insertions(+) diff --git a/wayland_backend.cpp b/wayland_backend.cpp index b29fa5b8f6..ddf6e9f767 100644 --- a/wayland_backend.cpp +++ b/wayland_backend.cpp @@ -24,6 +24,7 @@ along with this program. If not, see . #include "input.h" #include "main.h" #include "utils.h" +#include "wayland_server.h" #include #include #include @@ -40,6 +41,7 @@ along with this program. If not, see . #include #include #include +#include // Qt #include #include @@ -256,6 +258,15 @@ WaylandSeat::WaylandSeat(wl_seat *seat, WaylandBackend *backend) } } ); + WaylandServer *server = waylandServer(); + if (server) { + using namespace KWayland::Server; + SeatInterface *si = server->seat(); + connect(m_seat, &Seat::hasKeyboardChanged, si, &SeatInterface::setHasKeyboard); + connect(m_seat, &Seat::hasPointerChanged, si, &SeatInterface::setHasPointer); + connect(m_seat, &Seat::hasTouchChanged, si, &SeatInterface::setHasTouch); + connect(m_seat, &Seat::nameChanged, si, &SeatInterface::setName); + } } WaylandSeat::~WaylandSeat() diff --git a/wayland_server.cpp b/wayland_server.cpp index 3fe0773890..6bb59751f3 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -25,6 +25,7 @@ along with this program. If not, see . #include #include #include +#include #include using namespace KWayland::Server; @@ -69,6 +70,8 @@ void WaylandServer::init(const QByteArray &socketName) m_shell = m_display->createShell(m_display); m_shell->create(); m_display->createShm(); + m_seat = m_display->createSeat(m_display); + m_seat->create(); } void WaylandServer::initOutputs()