Diffusion KIO 1e251d2f6a42

Fix drop menu position on Wayland

Authored by elvisangelaccio on Jun 7 2017, 8:27 PM.

Description

Fix drop menu position on Wayland

On Wayland we can't rely on global cursor position.
In particual QCursor::pos() returns a wrong position
when called inside a dropEvent() function, which breaks
the DropJob's popup menus.

A more reliable solution is the position provided by the QDropEvent,
though this position is relative and we need a QWidget associated to the
job that can translate it to a global position.

Test Plan:
Drop something within a single Dolphin window from a wayland session.
Without the patch the popup shows up where the drag starts.
With the patch instead it shows up where the drag ends, as expected.

Differential Revision: https://phabricator.kde.org/D6142

Details