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

Mouse release events lost in wayland client

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • None
    • 5.8.0, 5.9.0 Beta 3
    • QPA: Wayland
    • None
    • Qt5.8.0 / current dev branch on Ubuntu 16.04

      There is a stripped down QML app attached that can be used to reproduce the issue. It implements a wayland client that needs to be run against a server, e.g. qwindow-compositor. Clicking on the red window will make a green window appear. Clicking again on the red window should set the green window to invisible. However, it does not, since only the pressed signal is received and released and clicked are discarded.

      The problem is that in src/client/qwaylandwindow.cpp in handleMouse() the QPA API QWindowSystemInterface::handleMouseEvent is called directly, but in src/client/qwaylanddisplay the call to QWindowSystemInterface::handleWindowActivated is queued. As a consequence the activated and mouse press event are handled in Qt in the wrong order, first press then activated. In turn this leads to a call to ungrabMouse() in qtdeclarative/src/quick/items/qquickwindow.cpp (in the
      QEvent::FocusAboutToChange case), which causes the following release event to be discarded (and hence also the click).

      The real use case was: https://bugreports.qt.io/browse/AUTOSUITE-105

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

            johanhelsing Johan Helsing
            bweimer Bernd Weimer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes