diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-12-14 21:07:08 +0100 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2019-04-25 07:00:09 +0000 |
commit | 23453c30084d09d7325e113bbc3d0637c51cb3e7 (patch) | |
tree | 6fe61eaeb57f0b6c928325af433439113fded158 /src/client/qwaylandinputdevice.cpp | |
parent | 88c47136d57edc45bddd0bec4ce7953b191f4a42 (diff) |
drop qwaylandxkb and share the logic with X11
QtWayland can benefit from sharing code with X11.
This will fix issues that have been reported and fixed on XCB
a long time ago.
Task-number: QTBUG-65503
Fixes: QTBUG-71301
Fixes: QTBUG-66497
Change-Id: I09cbf8e1c9cf29e8d7f46b97bc2f11d6e91b61a5
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/client/qwaylandinputdevice.cpp')
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 166be1934..17c408a3d 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -51,7 +51,6 @@ #include "qwaylandcursor_p.h" #include "qwaylanddisplay_p.h" #include "qwaylandshmbackingstore_p.h" -#include "../shared/qwaylandxkb_p.h" #include "qwaylandinputcontext_p.h" #include <QtGui/private/qpixmap_raster_p.h> @@ -493,7 +492,7 @@ Qt::KeyboardModifiers QWaylandInputDevice::Keyboard::modifiers() const if (!mXkbState) return ret; - ret = QWaylandXkb::modifiers(mXkbState.get()); + ret = QXkbCommon::modifiers(mXkbState.get()); #endif return ret; @@ -758,6 +757,8 @@ void QWaylandInputDevice::Keyboard::keyboard_keymap(uint32_t format, int32_t fd, mXkbKeymap.reset(xkb_keymap_new_from_string(mParent->mQDisplay->xkbContext(), map_str, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS)); + QXkbCommon::verifyHasLatinLayout(mXkbKeymap.get()); + munmap(map_str, size); close(fd); @@ -864,9 +865,8 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time, Qt::KeyboardModifiers modifiers = mParent->modifiers(); - int qtkey = 0; - QString text; - std::tie(qtkey, text) = QWaylandXkb::keysymToQtKey(sym, modifiers); + int qtkey = QXkbCommon::keysymToQtKey(sym, modifiers, mXkbState.get(), code); + QString text = QXkbCommon::lookupString(mXkbState.get(), code); QEvent::Type type = isDown ? QEvent::KeyPress : QEvent::KeyRelease; handleKey(time, type, qtkey, modifiers, code, sym, mNativeModifiers, text); |