From 6ddded0852f4718600c33eace732764e22876786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 21 Aug 2014 11:30:56 +0200 Subject: [PATCH] [kwin_wayland] Cleanup wayland_backend.[h|cpp] Remove no longer needed includes, turn one time slot methods into lambdas, etc. --- main_wayland.cpp | 1 + wayland_backend.cpp | 30 +++++++++--------------------- wayland_backend.h | 9 ++------- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/main_wayland.cpp b/main_wayland.cpp index 85a83b5101..8277ddfded 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -28,6 +28,7 @@ along with this program. If not, see . // Qt #include #include +#include // system #ifdef HAVE_UNISTD_H diff --git a/wayland_backend.cpp b/wayland_backend.cpp index 3888e58ed4..c62c54cf16 100644 --- a/wayland_backend.cpp +++ b/wayland_backend.cpp @@ -38,7 +38,6 @@ along with this program. If not, see . #include #include #include -#include #include // xcb #include @@ -370,10 +369,17 @@ WaylandBackend::WaylandBackend(QObject *parent) ); connect(m_registry, &Registry::outputAnnounced, this, [this](quint32 name) { - addOutput(m_registry->bindOutput(name, 2)); + Output *output = new Output(this); + output->setup(m_registry->bindOutput(name, 2)); + m_outputs.append(output); + connect(output, &Output::changed, this, &WaylandBackend::outputsChanged); + } + ); + connect(m_registry, &Registry::seatAnnounced, this, + [this](quint32 name) { + m_seat.reset(new WaylandSeat(m_registry->bindSeat(name, 2), this)); } ); - connect(m_registry, &Registry::seatAnnounced, this, &WaylandBackend::createSeat); connect(m_registry, &Registry::shmAnnounced, this, [this](quint32 name) { m_shm->setup(m_registry->bindShm(name, 1)); @@ -477,11 +483,6 @@ void WaylandBackend::initConnection() m_connectionThreadObject->initConnection(); } -void WaylandBackend::createSeat(uint32_t name) -{ - m_seat.reset(new WaylandSeat(m_registry->bindSeat(name, 2), this)); -} - void WaylandBackend::installCursorImage(Qt::CursorShape shape) { if (m_seat.isNull()) { @@ -525,19 +526,6 @@ void WaylandBackend::createSurface() } } -void WaylandBackend::addOutput(wl_output *o) -{ - Output *output = new Output(this); - output->setup(o); - m_outputs.append(output); - connect(output, &Output::changed, this, &WaylandBackend::outputsChanged); -} - -wl_registry *WaylandBackend::registry() -{ - return m_registry->registry(); -} - QSize WaylandBackend::shellSurfaceSize() const { if (m_shellSurface) { diff --git a/wayland_backend.h b/wayland_backend.h index af65a57b3a..73b6e4882b 100644 --- a/wayland_backend.h +++ b/wayland_backend.h @@ -22,20 +22,18 @@ along with this program. If not, see . // KWin #include // Qt -#include #include #include #include #include #include -// wayland -#include class QTemporaryFile; -class QImage; struct wl_cursor_theme; struct wl_buffer; +struct wl_display; struct wl_event_queue; +struct wl_seat; namespace KWin { @@ -128,12 +126,9 @@ class KWIN_EXPORT WaylandBackend : public QObject public: virtual ~WaylandBackend(); wl_display *display(); - wl_registry *registry(); Compositor *compositor(); - void addOutput(wl_output *o); const QList &outputs() const; ShmPool *shmPool(); - void createSeat(uint32_t name); Surface *surface() const; QSize shellSurfaceSize() const;