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

Scroll bar jump randomly in virtualbox linux guest

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.3.2
    • Fix Version/s: 5.11.2
    • Component/s: QPA: X11/XCB
    • Labels:
      None
    • Environment:
      ArchLinux up to date as a guest inside VirtualBox. The host can be Windows or Linux.

      Description

      I think this bug is related to VirtualBox, but this is a regression on Qt side. This bug doesn't exist in Qt 5.2.1

      This bug is reproducible very easily with a Linux or Windows host:

      • Just open a Qt5 application with a scroll bar.
      • Scroll to the bottom, the scroll bar may jump randomly to the top.
      • When the scroll bar is at the bottom, lose the focus on the window, (select another application...).
      • Get the focus back, try the scroll to the bottom by one step, the scroll bar jump to the top, the scroll bar should stay at the bottom.

      I did analyze this bug. If there are any bug, this is located inside plugins/platforms/xcb/

      I did enable debug, and I had some printf...

      • qxcbconnection.cpp: just before the return of xi2GetValuatorValueIfSet()
        printf("Len: %d  Num: %d  Offset: %d  Int: %d  Frac: %u  ", xideviceevent->valuators_len, valuatorNum, valuatorOffset, valuatorsValuesAddr[valuatorOffset].integral, valuatorsValuesAddr[valuatorOffset].frac);
        
      • qxcbconnection_xi2.cpp: just before 'We do not set "pixel" delta if it is only measured' in ticks.xi2HandleScrollEvent()
        printf("delta: %f  value: %f  v inc: %f  deltaY: %d\n", delta, value, scrollingDevice.verticalIncrement, angleDelta.y());
        

      The result is :

      Len: 2  Num: 3  Offset: 0  Int: -152  Frac: 0  delta: 1,000000  value: -152,000000  v inc: -1,000000  deltaY: -120
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 4 - XCB_BUTTON_PRESS - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 841
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 5 - XCB_BUTTON_RELEASE - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 841
      QXcbConnection: Unhandled XCB event: 28 - XCB_PROPERTY_NOTIFY - sequence: 631
      QXcbConnection: Unhandled XCB event: 28 - XCB_PROPERTY_NOTIFY - sequence: 631
      Len: 2  Num: 3  Offset: 0  Int: -153  Frac: 0  delta: 1,000000  value: -153,000000  v inc: -1,000000  deltaY: -120
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 4 - XCB_BUTTON_PRESS - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 843
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 5 - XCB_BUTTON_RELEASE - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 843
      Len: 2  Num: 3  Offset: 0  Int: -154  Frac: 0  delta: 1,000000  value: -154,000000  v inc: -1,000000  deltaY: -120
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 4 - XCB_BUTTON_PRESS - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 843
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 5 - XCB_BUTTON_RELEASE - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 843
      QXcbConnection: Unhandled XCB event: 28 - XCB_PROPERTY_NOTIFY - sequence: 631
      QXcbConnection: Unhandled XCB event: 28 - XCB_PROPERTY_NOTIFY - sequence: 631
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 6 - XCB_MOTION_NOTIFY - sequence: 631
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 6 - XCB_MOTION_NOTIFY - sequence: 631
      Len: 2  Num: 3  Offset: 0  Int: -1  Frac: 0  delta: -153,000000  value: -1,000000  v inc: -1,000000  deltaY: 18360
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 4 - XCB_BUTTON_PRESS - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 845
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 5 - XCB_BUTTON_RELEASE - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 845
      QXcbConnection: Unhandled XCB event: 28 - XCB_PROPERTY_NOTIFY - sequence: 631
      Len: 2  Num: 3  Offset: 0  Int: -2  Frac: 0  delta: 1,000000  value: -2,000000  v inc: -1,000000  deltaY: -120
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 4 - XCB_BUTTON_PRESS - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 846
      QXcbConnection: Unhandled XCB event: unknown event - response_type: 35 - sequence: 631
      QXcbConnection: Unhandled XCB event: 5 - XCB_BUTTON_RELEASE - sequence: 631
      QXcbConnection: Handled XCB event: unknown event - response_type: 85 - sequence: 846
      QXcbConnection: Unhandled XCB event: 28 - XCB_PROPERTY_NOTIFY - sequence: 631
      Len: 2  Num: 3  Offset: 0  Int: -3  Frac: 0  delta: 1,000000  value: -3,000000  v inc: -1,000000  deltaY: -120
      

      We can see that the variable: value is decremented during scroll down. Then when I lose the focus, and get it back the value is reseted to 0. The delta with the previous value is no longer equals to 1.00 but in this example : -153,00 => The scroll bar go up...

      To fix temporally this issue, I disabled Xinput2 with the following env variable QT5_NO_XINPUT2

      --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
      +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
      @@ -71,8 +71,10 @@ struct XInput2DeviceData {
       
       void QXcbConnection::initializeXInput2()
       {
      +    bool noInitXI2 = qEnvironmentVariableIsSet("QT5_NO_XINPUT2");
           debug_xinput = qEnvironmentVariableIsSet("QT_XCB_DEBUG_XINPUT");
           debug_xinput_devices = qEnvironmentVariableIsSet("QT_XCB_DEBUG_XINPUT_DEVICES");
      +    if (!noInitXI2) {
           Display *xDisplay = static_cast<Display *>(m_xlib_display);
           if (XQueryExtension(xDisplay, "XInputExtension", &m_xiOpCode, &m_xiEventBase, &m_xiErrorBase)) {
               int xiMajor = 2;
      @@ -97,6 +99,7 @@ void QXcbConnection::initializeXInput2()
       
               xi2SetupDevices();
           }
      +    }
       }
      

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-42415
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              allan.jensen Allan Sandfeld Jensen
              Reporter:
              benjarobin Benjamin Robin
              Votes:
              9 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes