From 3e39883a8a87f99521805ed1feb495bfbcfeef0c Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 15 Jan 2014 11:51:05 +0100 Subject: Fix build without xkbcommon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If6f0c5e14cea659a42dc0ba10c05356a5703ba14 Reviewed-by: Jørgen Lind --- src/client/qwaylandinputdevice.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index a979baff..46054128 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -736,17 +736,20 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, { Q_UNUSED(serial); QWaylandWindow *window = mFocus; + uint32_t code = key + 8; + bool isDown = state != 0; + QEvent::Type type = isDown ? QEvent::KeyPress : QEvent::KeyRelease; + QString text; + int qtkey = key + 8; // qt-compositor substracts 8 for some reason + #ifndef QT_NO_WAYLAND_XKB if (!mXkbMap) return; - uint32_t code = key + 8; - bool isDown = state != 0; const xkb_keysym_t *syms; uint32_t numSyms = xkb_key_get_syms(mXkbState, code, &syms); xkb_state_update_key(mXkbState, code, isDown ? XKB_KEY_DOWN : XKB_KEY_UP); - QEvent::Type type = isDown ? QEvent::KeyPress : QEvent::KeyRelease; if (!window) { // We destroyed the keyboard focus surface, but the server @@ -754,9 +757,6 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, return; } - int qtkey = key + 8; // qt-compositor substracts 8 for some reason - QString text; - if (numSyms == 1) { xkb_keysym_t sym = syms[0]; Qt::KeyboardModifiers modifiers = mParent->modifiers(); -- cgit v1.2.1