Make drags from the Task Manager less prone to disaster

Authored by hein on Jun 1 2018, 8:51 PM.

Description

Make drags from the Task Manager less prone to disaster

Summary:
The Task Manager applet previously set a task's launcher URL as
generic URL MIME data of drags initiated from it. This made
everything that's willing to handle an URL drop a drop target
for drags from the Task Manager, which resulted e.g. in users
accidentally dropping .desktop files into chat apps that would
immediately send them as a message.

In truth, the utility of drags initiated from the Task Manager
is mostly confined to the shell: Adding apps to the desktop, to
the panel, to launcher menus (we don't have this currently but
should add it), and so on. It's therefore appropriate to use a
special internal MIME type for this payload instead of one as
generic as text/url. We already use special internal MIME types
to shuttle around window ids (for drops onto pagers, to assign
tasks to different virtual desktops or activities) and filter
out drops onto the Task Manager applet itself.

This patch makes the necessary changes in the Task Manager and
in the Folder View containment, which needs special care due to
its complex drop handling. A seperate patch will augment
ContainmentInterface::processMimeData to take care of the Desktop
and Panel containments (while compatible with the Folder View
change).

This is an implementation of an idea by David Edmundson posted
in D13162.

Reviewers: davidedmundson, Zren

Subscribers: plasma-devel

Tags: Plasma

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

Details