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

Enter/Leave events not handled properly when QSizeGrip using startSystemResize()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.0
    • None
    • Linux/X11, Windows

    Description

      After a37785ec7638e7485112b87dd7e767881fecc114 it become apparent that we don't get mouse release event from X server when system move/resize ends (because WM is grabbing the pointer). The old code (before a37785ec) would wrongly deduce mouse move as mouse release, which is why the issue was not seen before. Even with the old code it had user experience issues. It can be tested by running qtbase/examples/widgets/mainwindows/mainwindow with QT_QPA_DISABLE_ENHANCED_MOUSE=1. Try shrinking the window until the cursor moves out of QSizeGrip widget's area, release the mouse. Cursor will not be restored until mouse gets moved (which gets deduced into release event as described above).

      The other platform that uses system move/resize feature via QSizeGrip is Windows. There the window system also does not send mouse events in this case. It has been worked around by https://codereview.qt-project.org/#/c/230827/ Any solution that requires making fake mouse events is sub-optimal and usually is a source of other bugs down the road.

      This should really be fixed at widget-level. Probably inside QWidgetWindow::handleEnterLeaveEvent(), where it should detect that if qt_last_mouse_receiver == QSizeGrip (where d->m_platformSizeGrip==true) and then properly dispatch enter/leave, which should take care of restoring the cursor.

      Note: When somebody will try to fix this at widget layer, set QT_XCB_NO_XI2=1 on X11 for testing. There seem to be some other unrelated enter/leave handling issues with XI2 code path. Those will be fixed in a separate patch once this issue has been resolved.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              paeglis Gatis Paeglis
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes