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

X11: use xcb instead of xlib for xinput features

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P3: Somewhat important
    • 5.12.0 Alpha
    • None
    • QPA: X11/XCB
    • None
    • Linux

    Description

      In qxcbconnection_xi2.cpp, QXcbConnection::xi2SetupDevices() uses XIQueryDevice(xDisplay, XIAllDevices, &deviceCount) to find the devices. This and all the logic inside the loop could apparently be done with these equivalent xcb structs and functions:

      typedef struct xcb_input_device_info_t {
          xcb_atom_t device_type;
          uint8_t    device_id;
          uint8_t    num_class_info;
          uint8_t    device_use;
          uint8_t    pad0;
      } xcb_input_device_info_t;
      
      typedef struct xcb_input_device_info_iterator_t {
          xcb_input_device_info_t *data;
          int                      rem;
          int                      index;
      } xcb_input_device_info_iterator_t;
      
       * Get the next element of the iterator
       * @param i Pointer to a xcb_input_device_info_iterator_t
       *
       * Get the next element in the iterator. The member rem is
       * decreased by one. The member data points to the next
       * element. The member index is increased by sizeof(xcb_input_device_info_t)
      
      void
      xcb_input_device_info_next (xcb_input_device_info_iterator_t *i );
      
      xcb_generic_iterator_t
      xcb_input_device_info_end (xcb_input_device_info_iterator_t i);
      
      xcb_input_device_info_iterator_t
      xcb_input_list_input_devices_devices_iterator (const xcb_input_list_input_devices_reply_t *R);
      
      

      Then we'd have one less need for using xlib.  An old goal was to get rid of it completely at some point.

      Attachments

        Issue Links

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

          Activity

            People

              avolkov Alexander Volkov
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes