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

Using qt-shell, if item in dialog is selected with mouse, no further focus navigation via keyboard possible

XMLWordPrintable

    • Linux/Wayland
    • 7aa053bba (dev), be4a8f598 (dev), 3190a1c91 (6.10), ed992e97b (6.10), 0082271f5 (6.9), 6ba3d5184 (6.9), 77b944db4 (tqtc/lts-6.8), 9564ef3d0 (tqtc/lts-6.8)

      As soon as an entry in the dropdown is selected via mouse click, the focus navigation at this state does not work with the keyboard. The reason for that is the compositor's contentItem getting focus instead of one of its children.

      This is closely related to this bug

      A brief investigation led to the supposition that something with the requestActivated() function could be the issue.

      Steps to reproduce

      1. Use the fancy-compositor example to set up a wayland compositor

      2. Change the fancy-compositor example's main.qml in order to get qt shell support

      WaylandCompositor {
          id: waylandCompositor
          QtShell {
              onQtShellSurfaceCreated: (qtShellSurface) => screen.handleShellSurface(qtShellSurface);
          }
           

      3. Start the minimal example below using qt shell (QT_WAYLAND_SHELL_INTEGRATION=qt-shell)

      #include "mainwindow.h"
      #include <QComboBox>
      #include <QVBoxLayout>
      #include <QLineEdit>
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QWidget win;
          win.resize(400, 300);
          win.show();
          auto cb = new QComboBox;
          cb->addItems({"Alpha", "Bravo", "Charlie"});
      
          auto layout = new QVBoxLayout(&win);
          layout->addWidget(new QLineEdit);
          layout->addWidget(cb);
          return app.exec();
      }
       

      4. Open the combo box in order to show the drop down

      5. Important: Select an item with a mouse click

      6. Try navigating the focus to other items via keyboard (tab) and see that this does not work in this state

        For Gerrit Dashboard: QTBUG-133866
        # Subject Branch Project Status CR V

            inho Inho Lee
            josefjoerg Josef Joerg
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: