Position grabbing popups correctly when started from hover events
If there is no known lastInputDevice, child popups will be randomly
positioned. This can happen when a popup is triggered by a hover event.
The obvious fix is to call setLastInputDevice from pointer_enter().
However, Weston (and probably other compositors) do not accept enter
events as valid grab serials. Calling setLastInputDevice from every pointer_enter would therefore completely disable menu popup on mouse-over for those compositors.
The solution is to only call setLastInputDevice when we have not seen one before. This means that the user may have to click once to get hover popups to work. This should be an acceptable price to pay to avoid menus appearing at random positions.
Fixes: QTBUG-128937
Change-Id: I446abb2f4bed65cb4c46ec89d08025cd6cd8e5f3
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>