[server] Properly handle the situation when the DataSource for a drag gets…

Authored by graesslin on Jan 27 2018, 1:12 PM.

Description

[server] Properly handle the situation when the DataSource for a drag gets destroyed

Summary:
This addresses the following situation:

  1. Start drag on a QtWayland based window
  2. Press escape
  3. Release mouse

-> this results in a crash. The main reason for this is that QtWayland
destroys the DataSource in step 2 and KWayland did not expect this at
all. The drag and drop operation continued and results in step 3 in the
drag target to request data from the no longer existing DataSource.

This change addresses the root of the problem by cancelling the drag
operation when the DataSource gets destroyed.

BUG: 389221
FIXED-IN: 5.44

Test Plan:
New test case exposing the problem and manual testing with
kwin_wayland and dolphin (based on bug report)

Reviewers: Frameworks, KWin, Plasma

Subscribers: plasma-devel

Tags: Frameworks, Plasma

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