1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

WindowServer+LibGUI: Pass the set of mime types being dragged to client

Previously the client would only learn the mime type of what was being
dropped on it once the drop occurred. To enable more sophisticated
filtering of drag & drop, we now pass along the list of mime types being
dragged to the client with each MouseMove event.

(Note that MouseMove is translated to the various Drag* events in LibGUI
on the client side.)
This commit is contained in:
Andreas Kling 2021-01-09 11:01:41 +01:00
parent 3b94af2c07
commit 67b91d51a7
15 changed files with 32 additions and 26 deletions

View file

@ -347,19 +347,19 @@ private:
class DragEvent final : public Event {
public:
DragEvent(Type type, const Gfx::IntPoint& position, const String& data_type)
DragEvent(Type type, const Gfx::IntPoint& position, Vector<String> mime_types)
: Event(type)
, m_position(position)
, m_data_type(data_type)
, m_mime_types(move(mime_types))
{
}
const Gfx::IntPoint& position() const { return m_position; }
const String& data_type() const { return m_data_type; }
const Vector<String>& mime_types() const { return m_mime_types; }
private:
Gfx::IntPoint m_position;
String m_data_type;
Vector<String> m_mime_types;
};
class DropEvent final : public Event {