diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-10-10 22:17:41 +0300 |
---|---|---|
committer | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-10-13 10:05:39 +0200 |
commit | 44e471834e193478d14ba8cfafd857a3bea867cc (patch) | |
tree | 3f38c418b17c4b09d8f97dfdad54ac0282463e3b /src/client/qwaylanddisplay.cpp | |
parent | 5558b42ff8536efdacb94b85a9bd4a00217314df (diff) | |
download | qtwayland-44e471834e193478d14ba8cfafd857a3bea867cc.tar.gz qtwayland-44e471834e193478d14ba8cfafd857a3bea867cc.tar.bz2 qtwayland-44e471834e193478d14ba8cfafd857a3bea867cc.zip |
Be compatible with older compositors
When binding globals take care of the version the compositor provides
and don't call requests that the compositor doesn't implement.
Change-Id: Iea0c534fb9e005720857e2778e380b6a9c22a6f3
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 8649a497..fda2c204 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -226,13 +226,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 +242,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 = new QWaylandInputDevice(this, id); + QWaylandInputDevice *inputDevice = new QWaylandInputDevice(this, version, id); mInputDevices.append(inputDevice); } else if (interface == QStringLiteral("wl_data_device_manager")) { mDndSelectionHandler.reset(new QWaylandDataDeviceManager(this, id)); |