Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-69480

Qt Virtual Keyboard cannot be interacted with or opened a second time when using the wayland platform plugin

    XMLWordPrintable

    Details

      Description

      Qt Virtual Keyboard's desktop integration method should work when using wayland with both Qt Quick and Qt Widgets applications. Using the pure-qml example as a compositor, I am able to get the virtual keyboard input panel to show up when clicking on e.g. QLineEdit, but there are a couple of issues:

      • When attemping to click on any key, the input panel (keyboard) closes.
      • On the dev branch, it’s not possible to get the keyboard to open a second time. This works with 5.11.

      Here's the output from the qt.virtualkeyboard logging category when interacting with a QLineEdit:

      Starting /home/mitch/dev/temp/widgets-qt5_dev_debug-Debug/widgets...
      Using Wayland-EGL
      Using the 'xdg-shell-v6' shell integration
      
      // Clicking in input field:
      
      qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QLineEdit(0x560e8857cfa0, name = "lineEdit")
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
      qt.virtualkeyboard: InputContext::setFocus(): true
      qt.virtualkeyboard: InputEngine::setInputMethod(): QtVirtualKeyboard::PlainInputMethod(0x560e88732b20)
      qt.virtualkeyboard: InputEngine::setInputMode(): QtVirtualKeyboard::InputEngine::InputMode(Latin)
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
      qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QLineEdit(0x560e8857cfa0, name = "lineEdit")
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
      qt.virtualkeyboard: InputContext::setLocale(): "en_GB"
      qt.virtualkeyboard: PlatformInputContext::setLocale(): QLocale(English, Latin, UnitedKingdom)
      qt.virtualkeyboard: InputEngine::setInputMode(): QtVirtualKeyboard::InputEngine::InputMode(Latin)
      qt.virtualkeyboard: PlatformInputContext::showInputPanel()
      qt.virtualkeyboard: DesktopInputPanel::repositionView(): QRect(0,0 1024x760)
      qt.virtualkeyboard: InputContext::setAnimating(): true
      qt.virtualkeyboard: InputContext::setAnimating(): false
      
      // Closing input panel:
      
      qt.virtualkeyboard: PlatformInputContext::commit()
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
      qt.virtualkeyboard: PlatformInputContext::commit()
      qt.virtualkeyboard: PlatformInputContext::hideInputPanel()
      qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QQuickRootItem(0x560e885910e0)
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
      qt.virtualkeyboard: InputContext::setFocus(): false
      
      // Attempting to open input panel again:
      
      qt.virtualkeyboard: PlatformInputContext::commit()
      qt.virtualkeyboard: PlatformInputContext::commit()
      qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QObject(0x0)
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
      qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QLineEdit(0x560e8857cfa0, name = "lineEdit")
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
      qt.virtualkeyboard: InputContext::setFocus(): true
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
      qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QLineEdit(0x560e8857cfa0, name = "lineEdit")
      qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
      

      I believe that http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/src/virtualkeyboard/desktopinputpanel.cpp would be the relevant place for any changes needed to get this to work.

      Steps to reproduce:

      1. Clone and build qtvirtualkeyboard and qtwayland
      2. Build the pure-qml example.
      3. Run it to start the compositor: QT_XCB_GL_INTEGRATION=xcb_egl ./pure-qml
      4. Run a widgets application that contains a text input with QT_IM_MODULE=qtvirtualkeyboard
      5. Click on the text input to get the virtual keyboard to show
      6. Try to press a key; the keyboard will close
      7. Click on the text input again; the keyboard will not show

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              jakoivik Jarkko Koivikko
              Reporter:
              mitch_curtis Mitch Curtis
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes