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
commit 67b91d51a7
Notes: sideshowbarker 2024-07-19 00:01:36 +09:00
15 changed files with 32 additions and 26 deletions

View file

@ -246,7 +246,7 @@ void WindowServerConnection::handle(const Messages::WindowClient::MouseMove& mes
{
if (auto* window = Window::from_window_id(message.window_id())) {
if (message.is_drag())
Core::EventLoop::current().post_event(*window, make<DragEvent>(Event::DragMove, message.mouse_position(), message.drag_data_type()));
Core::EventLoop::current().post_event(*window, make<DragEvent>(Event::DragMove, message.mouse_position(), message.mime_types()));
else
Core::EventLoop::current().post_event(*window, make<MouseEvent>(Event::MouseMove, message.mouse_position(), message.buttons(), to_gmousebutton(message.button()), message.modifiers(), message.wheel_delta()));
}