diff options
author | Johan Klokkhammer Helsing <johan.helsing@theqtcompany.com> | 2016-03-21 13:40:55 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@theqtcompany.com> | 2016-03-23 12:38:31 +0000 |
commit | d750ed81f9e7e08cd5b9981c50c8e4e5a8e4fbd3 (patch) | |
tree | 69aec0981ab1830531fd66dcbdfa6fc806aad77f /src/compositor/wayland_wrapper/qwldatadevice.cpp | |
parent | 90398eb31e4f46145f2761bd17a8e8b8bf2797c2 (diff) |
Compositor, drag-and-drop: Clean up drag focus when dropping
Problem: If you dragged in one client, then closed that client, opened
another one and tried to drag again, the compositor would crash.
Solution: Reset the drag focus when dropping or canceling the drag
operation.
Change-Id: I0ab78b0a3e9d2889db225b7ca45957b5148bb3a0
Reviewed-by: Erik Larsson <erik@ortogonal.com>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/qwldatadevice.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/qwldatadevice.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compositor/wayland_wrapper/qwldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index e8e96a7d6..c7de964d7 100644 --- a/src/compositor/wayland_wrapper/qwldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -142,12 +142,15 @@ void DataDevice::dragMove(QWaylandSurface *target, const QPointF &pos) void DataDevice::drop() { - if (m_dragFocusResource) + if (m_dragFocusResource) { send_drop(m_dragFocusResource->handle); + setDragFocus(nullptr, QPoint()); + } } void DataDevice::cancelDrag() { + setDragFocus(nullptr, QPoint()); } void DataDevice::data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) |