summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylanddisplay.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-11-07 14:43:24 +0200
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-11-15 18:46:38 +0100
commit4613291e8c1717d8d3316b2c0b1f2c6c96bdc56f (patch)
treed815d5dc56c46361146b2ee3ce2b6c2a2cc2c6bb /src/client/qwaylanddisplay.cpp
parent23ecb57e11bea42c2e90d280b21b6ee448a9afff (diff)
parent7882407bb6bab6c042fd20592a63a875b74eb581 (diff)
Merge branch '5.4' into dev
Merge done by Giulio Camuffo Conflicts: src/client/client.pro src/client/qwaylanddisplay.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandinputdevice_p.h src/client/qwaylandwindow.cpp src/compositor/compositor_api/qwaylandsurface.cpp src/compositor/compositor_api/qwaylandsurface_p.h src/compositor/wayland_wrapper/qwlsurface.cpp Change-Id: I1df878bb54f49d953c51215a2772869e261ebe81
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r--src/client/qwaylanddisplay.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index c4a702d74..023050326 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -159,6 +159,7 @@ QWaylandDisplay::QWaylandDisplay(QWaylandIntegration *waylandIntegration)
init(registry);
connect(mEventThreadObject, SIGNAL(newEventsRead()), this, SLOT(flushRequests()));
+ connect(mEventThreadObject, &QWaylandEventThread::fatalError, this, &QWaylandDisplay::exitWithError);
mWindowManagerIntegration.reset(new QWaylandWindowManagerIntegration(this));
@@ -177,8 +178,10 @@ QWaylandDisplay::~QWaylandDisplay(void)
void QWaylandDisplay::flushRequests()
{
- if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) < 0)
- mEventThreadObject->checkErrorAndExit();
+ if (wl_display_dispatch_queue_pending(mDisplay, mEventQueue) < 0) {
+ mEventThreadObject->checkError();
+ exitWithError();
+ }
wl_display_flush(mDisplay);
}
@@ -186,8 +189,15 @@ void QWaylandDisplay::flushRequests()
void QWaylandDisplay::blockingReadEvents()
{
- if (wl_display_dispatch_queue(mDisplay, mEventQueue) < 0)
- mEventThreadObject->checkErrorAndExit();
+ if (wl_display_dispatch_queue(mDisplay, mEventQueue) < 0) {
+ mEventThreadObject->checkError();
+ exitWithError();
+ }
+}
+
+void QWaylandDisplay::exitWithError()
+{
+ ::exit(1);
}
QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const
@@ -226,13 +236,14 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
struct ::wl_registry *registry = object();
if (interface == QStringLiteral("wl_output")) {
- QWaylandScreen *screen = new QWaylandScreen(this, id);
+ QWaylandScreen *screen = new QWaylandScreen(this, version, id);
mScreens.append(screen);
// We need to get the output events before creating surfaces
forceRoundTrip();
mWaylandIntegration->screenAdded(screen);
} else if (interface == QStringLiteral("wl_compositor")) {
- mCompositor.init(registry, id, 3);
+ mCompositorVersion = qMin((int)version, 3);
+ mCompositor.init(registry, id, mCompositorVersion);
} else if (interface == QStringLiteral("wl_shm")) {
mShm = static_cast<struct wl_shm *>(wl_registry_bind(registry, id, &wl_shm_interface,1));
} else if (interface == QStringLiteral("xdg_shell")
@@ -241,7 +252,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
} else if (interface == QStringLiteral("wl_shell")){
mShell.reset(new QtWayland::wl_shell(registry, id, 1));
} else if (interface == QStringLiteral("wl_seat")) {
- QWaylandInputDevice *inputDevice = mWaylandIntegration->createInputDevice(this, id);
+ QWaylandInputDevice *inputDevice = mWaylandIntegration->createInputDevice(this, version, id);
mInputDevices.append(inputDevice);
} else if (interface == QStringLiteral("wl_data_device_manager")) {
mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id));