Change wl_event_queue to KWayland::Client::EventQueue

Requires e708af8c9dfaa2eb0d95f5e2b5059890885c5f74 in kwayland.
icc-effect-5.14.5
Martin Gräßlin 2014-09-23 13:15:49 +02:00
parent b8837b66f3
commit 7242f64d4c
2 changed files with 8 additions and 13 deletions

View File

@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KWayland/Client/buffer.h>
#include <KWayland/Client/compositor.h>
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/event_queue.h>
#include <KWayland/Client/fullscreen_shell.h>
#include <KWayland/Client/keyboard.h>
#include <KWayland/Client/output.h>
@ -336,7 +337,7 @@ WaylandBackend *WaylandBackend::create(QObject *parent)
WaylandBackend::WaylandBackend(QObject *parent)
: QObject(parent)
, m_display(nullptr)
, m_eventQueue(nullptr)
, m_eventQueue(new EventQueue(this))
, m_registry(new Registry(this))
, m_compositor(new Compositor(this))
, m_shell(new Shell(this))
@ -402,6 +403,7 @@ WaylandBackend::~WaylandBackend()
m_registry->release();
m_seat.reset();
m_shm->release();
m_eventQueue->release();
m_connectionThreadObject->deleteLater();
m_connectionThread->quit();
@ -424,22 +426,13 @@ void WaylandBackend::initConnection()
[this]() {
// create the event queue for the main gui thread
m_display = m_connectionThreadObject->display();
m_eventQueue = wl_display_create_queue(m_display);
m_eventQueue->setup(m_connectionThreadObject);
m_registry->setEventQueue(m_eventQueue);
// setup registry
m_registry->create(m_display);
wl_proxy_set_queue((wl_proxy*)m_registry->registry(), m_eventQueue);
m_registry->setup();
},
Qt::QueuedConnection);
connect(m_connectionThreadObject, &ConnectionThread::eventsRead, this,
[this]() {
if (!m_eventQueue) {
return;
}
wl_display_dispatch_queue_pending(m_display, m_eventQueue);
wl_display_flush(m_display);
},
Qt::QueuedConnection);
connect(m_connectionThreadObject, &ConnectionThread::connectionDied, this,
[this]() {
emit systemCompositorDied();
@ -462,6 +455,7 @@ void WaylandBackend::initConnection()
}
m_compositor->destroy();
m_registry->destroy();
m_eventQueue->destroy();
if (m_display) {
m_display = nullptr;
}

View File

@ -42,6 +42,7 @@ namespace Client
class ShmPool;
class Compositor;
class ConnectionThread;
class EventQueue;
class FullscreenShell;
class Keyboard;
class Output;
@ -153,7 +154,7 @@ private:
void destroyOutputs();
void checkBackendReady();
wl_display *m_display;
wl_event_queue *m_eventQueue;
KWayland::Client::EventQueue *m_eventQueue;
KWayland::Client::Registry *m_registry;
KWayland::Client::Compositor *m_compositor;
KWayland::Client::Shell *m_shell;