summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandkeyboard.cpp
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2015-11-25 19:41:14 +0100
committerPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2015-11-28 16:48:49 +0000
commit68993c012b88df43b2cd75a8c8704092760f28c0 (patch)
tree3d5b97c0960472df2cd0e8aa8d224203ceb7679b /src/compositor/compositor_api/qwaylandkeyboard.cpp
parent02fa8b9ef89b6874effea8d219bcbba0319a263c (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/qwaylandkeyboard.cpp')
-rw-r--r--src/compositor/compositor_api/qwaylandkeyboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp
index 76e9a39a6..f39bb3e04 100644
--- a/src/compositor/compositor_api/qwaylandkeyboard.cpp
+++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp
@@ -557,10 +557,10 @@ void QWaylandKeyboard::setKeymap(const QWaylandKeymap &keymap)
/*!
* \internal
*/
-void QWaylandKeyboard::addClient(QWaylandClient *client, uint32_t id)
+void QWaylandKeyboard::addClient(QWaylandClient *client, uint32_t id, uint32_t version)
{
Q_D(QWaylandKeyboard);
- d->add(client->client(), id, QtWaylandServer::wl_keyboard::interfaceVersion());
+ d->add(client->client(), id, qMin<uint32_t>(QtWaylandServer::wl_keyboard::interfaceVersion(), version));
}
QT_END_NAMESPACE