Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.8.0, 5.9.0 Beta 3
-
None
-
Qt5.8.0 / current dev branch on Ubuntu 16.04
Description
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