[kwin_wayland] Cleanup wayland_backend.[h|cpp]

Remove no longer needed includes, turn one time slot methods into
lambdas, etc.
This commit is contained in:
Martin Gräßlin 2014-08-21 11:30:56 +02:00
parent 46f2b252d8
commit 6ddded0852
3 changed files with 12 additions and 28 deletions

View file

@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Qt
#include <qplatformdefs.h>
#include <QCommandLineParser>
#include <QFile>
// system
#ifdef HAVE_UNISTD_H

View file

@ -38,7 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QAbstractEventDispatcher>
#include <QCoreApplication>
#include <QDebug>
#include <QImage>
#include <QThread>
// xcb
#include <xcb/xtest.h>
@ -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) {

View file

@ -22,20 +22,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// KWin
#include <kwinglobals.h>
// Qt
#include <QDir>
#include <QHash>
#include <QImage>
#include <QObject>
#include <QPoint>
#include <QSize>
// wayland
#include <wayland-client.h>
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<Output*> &outputs() const;
ShmPool *shmPool();
void createSeat(uint32_t name);
Surface *surface() const;
QSize shellSurfaceSize() const;