summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland_common/qwaylandeventthread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wayland_common/qwaylandeventthread.cpp')
-rw-r--r--src/plugins/platforms/wayland_common/qwaylandeventthread.cpp63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/plugins/platforms/wayland_common/qwaylandeventthread.cpp b/src/plugins/platforms/wayland_common/qwaylandeventthread.cpp
deleted file mode 100644
index 3392d36c6..000000000
--- a/src/plugins/platforms/wayland_common/qwaylandeventthread.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-#include "qwaylandeventthread.h"
-#include <QtCore/QSocketNotifier>
-#include <QCoreApplication>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <errno.h>
-
-QT_BEGIN_NAMESPACE
-
-QWaylandEventThread::QWaylandEventThread(QObject *parent)
- : QObject(parent)
- , m_display(0)
- , m_fileDescriptor(-1)
- , m_readNotifier(0)
- , m_displayLock(new QMutex)
-{
-}
-
-QWaylandEventThread::~QWaylandEventThread()
-{
- delete m_displayLock;
- wl_display_disconnect(m_display);
-}
-
-void QWaylandEventThread::displayConnect()
-{
- m_displayLock->lock();
- QMetaObject::invokeMethod(this, "waylandDisplayConnect", Qt::QueuedConnection);
-}
-
-void QWaylandEventThread::readWaylandEvents()
-{
- if (wl_display_dispatch(m_display) == -1 && errno == EPIPE) {
- qWarning("The Wayland connection broke. Did the Wayland compositor die?");
- ::exit(1);
- }
- emit newEventsRead();
-}
-
-void QWaylandEventThread::waylandDisplayConnect()
-{
- m_display = wl_display_connect(NULL);
- if (m_display == NULL) {
- qErrnoWarning(errno, "Failed to create display");
- ::exit(1);
- }
- m_displayLock->unlock();
-
- m_fileDescriptor = wl_display_get_fd(m_display);
-
- m_readNotifier = new QSocketNotifier(m_fileDescriptor, QSocketNotifier::Read, this);
- connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(readWaylandEvents()));
-}
-
-wl_display *QWaylandEventThread::display() const
-{
- QMutexLocker displayLock(m_displayLock);
- return m_display;
-}
-
-QT_END_NAMESPACE