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

Shift button on virtual keyboard is disabled on startup of application

    XMLWordPrintable

Details

    • 90d64dea7d0370abcb5b787bcc77dc4770f491ed (qt/qtvirtualkeyboard/dev) 84c0466a53 (qt/tqtc-qtvirtualkeyboard/5.15) 84c0466a53 (qt/tqtc-qtvirtualkeyboard/5.15.10)

    Description

      When focus is initially set on TextField from the start of application, shift key on virtual keyboard will be disabled until user clicks on TextField.

      I have looked into the issue, it seems like the problem is that in QGuiApplicationPrivate::processActivatedEvent.

      1. First we call:
        QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn),
      2. sendSpontaneousEvent will trigger ShiftHandler::reset(), that will try to get d->inputContext->priv()->inputItem() - which is currently focused item. And currently focused item is currently null and will be set only later(see below).
      3. And after ShiftHandler::reset(which fail to update inputMethodHints) in QGuiApplicationPrivate::processActivatedEvent we call
        self->_q_updateFocusObject(qApp->focusObject());
        This line actually sets currently focused item, but there will be no call to ShiftHandler::reset() later to observe this change.
         
        I have attached a repoduction.

      Is there any workaround for this issue?

      Attachments

        Issue Links

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

          Activity

            People

              jakoivik Jarkko Koivikko
              snarpix Stanislav Shmarov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes