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

WheelEvents get set with a pixelDelta even when using a physical mouse wheel under new libinput

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.8.0
    • Fix Version/s: 5.9.5, 5.10.1
    • Labels:
      None
    • Environment:

      Linux, Xorg, libInput

      Description

      Scrolling has two modes, moving by n pixels or by n "ticks" normally for trackpads and traditional scroll wheels respectively.

      In QWheelEvent terms:

      • pixelDelta and angleDelta

      A libinput change has meant that Qt's detection of "is it a scroll wheel or not" is broken.

      If I put debug in QXcbConnection::xi2HandleScrollEvent I can see my scrollingDevice.verticalIncrement is 15 .

      We then go into the

      // We do not set "pixel" delta if it is only measured in ticks.
      if (scrollingDevice.horizontalIncrement > 1)
      rawDelta.setX(delta);

      This matches what I see in xinput list which shows:
      Class originated from: 11. Type: XIScrollClass
      Scroll info for Valuator 2
      type: 2 (horizontal)
      increment: 15.000000
      flags: 0x0

      So QXcbConnection has the "right" value, but now that check doesn't work. I think libinput seems to trying to artificially say how far things should scroll at an input level rather than it being up to the application.

      Though this is the root cause of the breakage, it is only a minor problem except in one place.

      In QtQuickControls QtQuickWheelArea as we now have valid pixelDelta we go into a different code path that ignores the user scrollspeed. It then also randomly divides things by 2 to match some OS X trackpad behaviour. See comment on the static pixelDeltaAdjustment.

      Instead of the scroll moving content at the correct rate of 60px (15x user set scrollSpeed) per tick, we only move 7.5 (15/2) pixels. This leads to very slow scrolling with bug reports downstream (KDE) and in some cases text corruption as it's not pixel aligned anymore.

      To see the bug in action run ListPage.qml in QtQuickControls example with a proper mouse wheel.

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                allan.jensen Allan Sandfeld Jensen
                Reporter:
                davidedmundson David Edmundson
              • Votes:
                7 Vote for this issue
                Watchers:
                15 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes