[Interest] Issue with VirtualKeyboad and Wayland compositor.

Christian Gagneraud chgans at gmail.com
Wed Oct 17 23:57:04 CEST 2018


On Wed, 17 Oct 2018 at 17:20, Christian Gagneraud <chgans at gmail.com> wrote:
>
> On Wed, 17 Oct 2018 at 13:51, Christian Gagneraud <chgans at gmail.com> wrote:
> >
> > I'm running the QtWayland 'pure-qml' example on an imx61 board with
> > linuxfb QPA, Qt-5.11.1 (I'm waiting for a 5.11.2 build).
> > I followed instructions from
> > http://doc.qt.io/qt-5/qtvirtualkeyboard-deployment-guide.html#using-qt-virtual-keyboard-with-qt-wayland.
> > The wayland client is the QtWidget's 'wiggly' example.
> >
> > When I click on the QLineEdit of Wiggly, the VKB pops up, but every
> > key i tap send QKeyEvent to wiggly, where the key code is always null
> > (zero).
>
> So i've run the same setup on Linux Desktop with Qt-5.11.1 and
> Qt-5.11.2 and it works as expected in both cases.
> I have as well enabled WAYLAND_DEBUG, and discovered that the problem
> lies somewhere b/w Qt VKB and QWaylandCompositor, here is a trace that
> show the lost of the key code:
>
> Logs from pure-qml:
> ...
> qt.virtualkeyboard: InputContext::::sendKeyClick(): 16777219
> [2541671.231] -> zwp_text_input_v2 at 14.keysym(0, 0, 1, 0)
> [2541671.480] -> zwp_text_input_v2 at 14.keysym(0, 0, 0, 0)
> ...
>
> Will investigate, to see the difference of wayland version b/w Linux
> Desktop and our custom embedded Linux distro.

After digging into QtWayland source code, it looks like a bug in
QtWayland, on Desktop it relies on Xkbcommon, on target it seems to
use native scan code, but implementation might not be fully
working/implemented.
Will create a bug report.

Chris

> Chris
>
>
> >
> > The key codes are correct on the wayland compositor side, from Qt logging:
> > qt.virtualkeyboard: InputEngine::virtualKeyPress(): Qt::Key(Key_O) "O"
> > QFlags<Qt::KeyboardModifiers>(ShiftModifier) false
> > qt.virtualkeyboard: InputEngine::virtualKeyRelease(): Qt::Key(Key_O)
> > "O" QFlags<Qt::KeyboardModifiers>(ShiftModifier)
> > qt.virtualkeyboard: InputContext::::sendKeyClick(): 79
> >
> > But from Wiggly (dumping QKeyEvent via eventFilter on the line edit):
> > QKeyEvent(KeyRelease, 0)
> > QKeyEvent(KeyPress, 0)
> > QKeyEvent(KeyRelease, 0)
> > QKeyEvent(KeyPress, 0)
> > QKeyEvent(KeyRelease, 0)
> >
> > All of the above is done with QtCreator:
> >
> > Wiggly is run with "-platform wayland" command line arguments and the
> > following 'Clean Run Environment':
> > QML2_IMPORT_PATH=/usr/lib/qt-5.11.1-imx61-shared/qml
> > QT_PLUGIN_PATH=/usr/lib/qt-5.11.1-imx61-shared/plugins
> > QT_QPA_PLATFORM=wayland
> > XDG_RUNTIME_DIR=/tmp
> >
> > pure-qml is run with "-platform linuxfb -plugin evdevtouch" command
> > line arguments and the following 'Clean Run Environment':
> > QML2_IMPORT_PATH=/usr/lib/qt-5.11.1-imx61-shared/qml
> > QT_IM_MODULE=qtvirtualkeyboard
> > QT_LOGGING_DEBUG=1
> > QT_LOGGING_RULES=qt.virtualkeyboard=true;qt.qpa.wayland*=true;
> > QT_PLUGIN_PATH=/usr/lib/qt-5.11.1-imx61-shared/plugins
> > QT_QPA_FB_DISABLE_INPUT=1
> > QT_QPA_FONTDIR=/usr/share/fonts
> > XDG_RUNTIME_DIR=/tmp
> > ___QML_IMPORT_TRACE=1
> > ___QT_DEBUG_PLUGINS=1
> >
> > Any idea about what is going on? As anyone successfully use such a setup?
> > Any tip on how to debug this further?
> >
> > Thanks,
> > Chris
> >
> > Notes:
> >
> > I have issues with udev and /dev/input, not sure if this can influence
> > the VKB. I'm currently waiting for a fix from our platform team.
> >
> > Full log from pure-qml:
> >
> > QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
> > QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
> > Failed to open tty (No such device)
> > This plugin does not support createPlatformOpenGLContext!
> > QtCompositor: Failed to initialize EGL display. Could not get
> > EglDisplay for window.
> > qt.virtualkeyboard: InputContext::setLocale(): "en_GB"
> > qt.virtualkeyboard: PlatformInputContext::setLocale():
> > QLocale(English, Latin, UnitedKingdom)
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
> > qt.virtualkeyboard: PlatformInputContext::setFocusObject():
> > QQuickRootItem(0x80368)
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImQueryAll)
> > qt.virtualkeyboard: PlatformInputContext::commit()
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
> > qt.virtualkeyboard: PlatformInputContext::setFocusObject():
> > Chrome_QMLTYPE_4(0x321f98)
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImQueryAll)
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImEnabled|ImQueryInput)
> > qt.virtualkeyboard: InputContext::setFocus(): true
> > qt.virtualkeyboard: InputEngine::setInputMethod():
> > QtVirtualKeyboard::PlainInputMethod(0xa51e0)
> > qt.virtualkeyboard: InputEngine::setInputMode():
> > QtVirtualKeyboard::InputEngine::InputMode(Latin)
> > qt.virtualkeyboard: PlatformInputContext::reset()
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImEnabled|ImMicroFocus|ImCursorPosition|ImSurroundingText|ImCurrentSelection|ImAnchorPosition)
> > qt.virtualkeyboard: InputEngine::reselect(): 12 QFlags(0x1|0x2)
> > qt.virtualkeyboard: PlatformInputContext::reset()
> > qt.virtualkeyboard: PlatformInputContext::update():
> > QFlags<Qt::InputMethodQuery>(ImEnabled|ImMicroFocus)
> > qt.virtualkeyboard: PlatformInputContext::showInputPanel()
> > qt.virtualkeyboard: InputEngine::virtualKeyPress():
> > Qt::Key(Key_Backspace) "" QFlags<Qt::KeyboardModifiers>(ShiftModifier)
> > true
> > qt.virtualkeyboard: InputEngine::virtualKeyRelease():
> > Qt::Key(Key_Backspace) "" QFlags<Qt::KeyboardModifiers>(ShiftModifier)
> > qt.virtualkeyboard: InputContext::::sendKeyClick(): 16777219
> > ...
> >
> > Not sure if the iconv and tty warnings are related.
> >
> > Full log from wiggly:
> >
> > QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
> > QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
> > Using Wayland-EGL
> > EGL not available
> > Using the 'xdg-shell-v6' shell integration
> > QFocusEvent(FocusIn, ActiveWindowFocusReason)
> > QKeyEvent(KeyPress, 0) 0
> > QKeyEvent(KeyRelease, 0) 0
> > ...
> >
> > Currently EGL is not ready, hence the warnings, I beleive this is not
> > an issue here as QtWayland will fallback to SHM buffers.



More information about the Interest mailing list