diff options
author | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2015-05-12 08:29:41 +0200 |
---|---|---|
committer | Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> | 2016-03-22 14:10:59 +0000 |
commit | 6341bf99c981aa3cfbb01589e499aa4b3f6dca21 (patch) | |
tree | 2445d811458dbee8d92c01def383dd13e8e086eb /src/compositor/compositor_api/qwaylandkeyboard.cpp | |
parent | ff3900e52370a48f9aaa6894c974272273681093 (diff) |
Send keyboard repeat information
Complete the API for keyboard rate and delay that was previously
implemented sending the information to clients.
Back then this wasn't possible for lack of Wayland >= 1.6 on
the CI system.
Change-Id: I95bab22bf4eea6549d2f8a762341c6485a24665c
Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'src/compositor/compositor_api/qwaylandkeyboard.cpp')
-rw-r--r-- | src/compositor/compositor_api/qwaylandkeyboard.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/compositor/compositor_api/qwaylandkeyboard.cpp b/src/compositor/compositor_api/qwaylandkeyboard.cpp index 65d31fb33..a707d6470 100644 --- a/src/compositor/compositor_api/qwaylandkeyboard.cpp +++ b/src/compositor/compositor_api/qwaylandkeyboard.cpp @@ -146,6 +146,10 @@ void QWaylandKeyboardPrivate::focused(QWaylandSurface *surface) void QWaylandKeyboardPrivate::keyboard_bind_resource(wl_keyboard::Resource *resource) { + // Send repeat information + if (resource->version() >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) + send_repeat_info(resource->handle, repeatRate, repeatDelay); + #ifndef QT_NO_WAYLAND_XKB if (xkb_context) { send_keymap(resource->handle, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, @@ -368,6 +372,14 @@ void QWaylandKeyboardPrivate::createXKBKeymap() } #endif +void QWaylandKeyboardPrivate::sendRepeatInfo() +{ + Q_FOREACH (Resource *resource, resourceMap()) { + if (resource->version() >= WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION) + send_repeat_info(resource->handle, repeatRate, repeatDelay); + } +} + /*! * \class QWaylandKeyboard * \inmodule QtWaylandCompositor @@ -477,12 +489,7 @@ void QWaylandKeyboard::setRepeatRate(quint32 rate) if (d->repeatRate == rate) return; - // TODO: As of today 2015-11-25, we don't support Wayland 1.6 - // because of CI limitations. Once the protocol is updated - // we can send keyboard repeat information to the client as - // per wl_seat version 4 - - qWarning("Setting QWaylandKeyboard::repeatRate has no effect until QtWaylandCompositor support wl_seat 4"); + d->sendRepeatInfo(); d->repeatRate = rate; Q_EMIT repeatRateChanged(rate); @@ -507,12 +514,7 @@ void QWaylandKeyboard::setRepeatDelay(quint32 delay) if (d->repeatDelay == delay) return; - // TODO: As of today 2015-11-25, we don't support Wayland 1.6 - // because of CI limitations. Once the protocol is updated - // we can send keyboard repeat information to the client as - // per wl_seat version 4 - - qWarning("Setting QWaylandKeyboard::repeatDelay has no effect until QtWaylandCompositor support wl_seat 4"); + d->sendRepeatInfo(); d->repeatDelay = delay; Q_EMIT repeatDelayChanged(delay); |