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

Details

    • Linux/Wayland

    Description

      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

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              josefjoerg Josef Joerg
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes