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

startSystemMove/startSystemResize causing mouse events to be lost on X11(MATE)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.3
    • 5.15.2
    • QPA: X11/XCB
    • None
    • Linux/X11
    • 8e506fdd299d2fa18172209bea316f484e234e19, c1649ae3f (tqtc/lts-6.2), 4fc863f6c (tqtc/lts-5.15)

    Description

      This seem to be the same as https://bugreports.qt.io/browse/QTBUG-68501.

       

      startSystemMove/startSystemResize were private APIs at the time of the report and looks like this was hacked on QSizeGrip side instead. But now they are public APIs and the bug still exists. Calling startSystemMove or startSystemResize causes mouse events to be handled really weird in the entire app. Some widgets don't get MouseMove events, other getting, but QWidget::isAncestorOf returns true even if the widget is not a child of that another widget. The most annoying thing is if you have startSystemMove being called on mouseMoveEvent (in order to allow maximizing by double click on a custom titlebar), Qt calls it as soon as moving was ended (app enters into an endless moving state). I tried to add a check for QMouseEvent::buttons into mouseMoveEvent and don't call startSystemMove if it is Qt::NoButton: it helps in most cases, but not in all, unfortuantely . As a result of this, the behavior (endless moving state) became randomly and happens only at certain conditions, like snapping to screen edges (i guess that's because the cursor is out of window on mouse button release and Qt doesn't understand that the button was released even in MouseMove event).

       

      gtk applications don't have this behavior even though they all using _NET_WM_MOVERESIZE, so I checked what they doing and found that they have a way how to determine when move/resize is done and doing some stuff in order to not to have this buggy behavior:

      https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gdk/x11/gdkdisplay-x11.c#L971-977

      https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gdk/x11/gdksurface-x11.c#L4335

      https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gdk/x11/gdksurface-x11.c#L4215-4219

      https://gitlab.gnome.org/GNOME/gtk/-/blob/master/gdk/x11/gdksurface-x11.c#L3876-3887

      Attachments

        Issue Links

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

          Activity

            People

              liaqi Liang Qi
              ilya-fedin Ilya Fedin
              Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes