diff options
author | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2015-11-25 19:41:14 +0100 |
---|---|---|
committer | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2015-11-28 16:48:49 +0000 |
commit | 68993c012b88df43b2cd75a8c8704092760f28c0 (patch) | |
tree | 3d5b97c0960472df2cd0e8aa8d224203ceb7679b /src/compositor/compositor_api/qwaylandpointer.cpp | |
parent | 02fa8b9ef89b6874effea8d219bcbba0319a263c (diff) |
Add clients with the correct version
Wayland clients might implement an older interface version, in that
case we don't want to send unsupported requests.
To ensure that we pick the lower version between the one asked by
the client and the one we actually implement on the server.
Change-Id: I4865780505db171295897fc7f6567c6f88e598fa
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandpointer.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandpointer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandpointer.cpp b/src/compositor/compositor_api/qwaylandpointer.cpp index f0e2ee8ea..51b1f791d 100644 --- a/src/compositor/compositor_api/qwaylandpointer.cpp +++ b/src/compositor/compositor_api/qwaylandpointer.cpp @@ -273,10 +273,10 @@ bool QWaylandPointer::isButtonPressed() const /*! * \internal */ -void QWaylandPointer::addClient(QWaylandClient *client, uint32_t id) +void QWaylandPointer::addClient(QWaylandClient *client, uint32_t id, uint32_t version) { Q_D(QWaylandPointer); - d->add(client->client(), id, QtWaylandServer::wl_pointer::interfaceVersion()); + d->add(client->client(), id, qMin<uint32_t>(QtWaylandServer::wl_pointer::interfaceVersion(), version)); } /*! |