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

XCB_MAPPING_NOTIFY not delivered when -no-xkb with -xcb-xlib is used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 5.0.2
    • None
    • Xlib-xcb

    Description

      INIT:

      Add debug statement in the qxcbconnection.cpp:

              case XCB_MAPPING_NOTIFY:
                  qDebug() << "XCB_MAPPING_NOTIFY";
                  m_keyboard->handleMappingNotifyEvent((xcb_mapping_notify_event_t *)event);
                  break;
      

      1) Compile and run the provided example.
      2) Add or remove any keyboard layout from system's keyboard layout settings.

      EXPECTED:

      Message XCB_MAPPING_NOTIFY in the output.

      ACTUAL:

      No XCB_MAPPING_NOTIFY message in the output.

      class MainWindow : public QWidget
      {
          Q_OBJECT
      public:
          explicit MainWindow(QWidget *parent = 0);
      protected:
      
      };
      
      MainWindow::MainWindow(QWidget *parent) :
          QWidget(parent)
      {
          QVBoxLayout *layout = new QVBoxLayout(this);
      
          QPushButton *fiveButton = new QPushButton("5");
      
          QTextEdit *edit = new QTextEdit;
      
          layout->addWidget(fiveButton);
          layout->addWidget(edit);
      
          fiveButton->setShortcut(QKeySequence(Qt::Key_5));
      }
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          MainWindow w;
          w.show();
      
          return a.exec();
      }
      

      If we type something in the text field and then repeat the test case, then message XCB_MAPPING_NOTIFY appears in the output - as expected. So unless user triggers QXcbKeyboard::handleKeyEvent (which in turn calls XLookupString) Qt is not receiving mapping notify events which are stuck somewhere in the Xlib's event queue. Related bug report on freedesktop bug tracker https://bugs.freedesktop.org/show_bug.cgi?id=23202

      Running test application under:

      xtrace ./testapp | grep -i mapping

      I can see that MappingNotify is deliver for both test cases, but for some reason Xlib holds it to itself..

      Attachments

        1. mapping-c.tar.gz
          1 kB
          Gatis Paeglis

        Issue Links

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

          Activity

            People

              paeglis Gatis Paeglis
              paeglis Gatis Paeglis
              Votes:
              5 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes