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

[Wayland] If the mouse to change the focus widget while a popup widget is open, then mouse/keyboard interactions will break

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      The example below uses a QComboBox to trigger the problem, but the customer also reported similar outcomes with QMenu and QContextMenu.

       

      Code

      #include <QtWidgets>
      
      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();
      }
      

       

      Core steps to trigger the problem

      Click on the QComboBox to open the popup, and select an item. Do this twice to trigger the warning, "qt.qpa.wayland: Wayland does not support QWindow::requestActivate()"

       

      Detailed tests
      Try these before and after triggering the warning:

      1. Press the Tab key to move focus between the QLineEdit and QComboBox
      2. While the QComboBox has focus, press the Up and Down keys to change QComboBox::currentItem
      3. Click on each of the widgets

       

      Expected Outcomes (before triggering the warning)

      • (1) Each key press will move the "focus border" to the next widget
      • (2) Each key press will change QComboBox::currentItem
      • (3) Nothing interesting happens with each click

       

      Actual Outcomes (After triggering the warning)

      • (1) Nothing happens with each key press
      • (2) Nothing happens with each key press
      • (3) Each click triggers the warning, "qt.qpa.wayland: Wayland does not support QWindow::requestActivate()"

       

      Notes

      • Switching focus to a different window un-breaks things. Just repeat the steps above to break it again.
      • Qt 5.15.17 LTS and 6.2.12 LTS are affected, but Qt 6.5.6 LTS and 6.7.2 are not

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes