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

xcb event masks are set incorrectly on big endian

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.5
    • Linux hakua 5.4.206 #1 SMP Mon Jul 18 16:54:22 CEST 2022 ppc64 POWER9, altivec supported PowerNV T2P9D01 REV 1.00 GNU/Linux

      Gentoo 17.0 desktop
    • Linux/X11

    Description

      Input masks in XInput2 are arrays of bytes. Xlib provides convenience
      macros XISetMask(), XIClearMask() and XIMaskIsSet() for finding the
      correct byte in case the event number is 8 or larger. However, Qt
      does not set up an array of bytes but rather a single 32-bit integer,
      and assumes that as long as all events have numbers smaller than 32 it
      can just set the corresponding bit in the 32-bit integer. This
      happens to work on little endian since the byte order on LE matches
      the hard-coded byte order of the input masks in XInput2. However, it
      does not work on big endian where the byte order differs.

      The issue can be observed in two ways on a big endian system:

      • Mouse wheel events are not received
      • Menus and other grab contexts do not receive mouse input (except if
        QT_XCB_NO_XI2_MOUSE is set)

      In my proposed patch (attached), I did not rewrite the code to use an array of bytes but simply added a conversion to little endian of the 32-bit integer, which solves the immediate issue.

       

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              marcus_c Marcus Comstedt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change