mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibGUI+WindowServer: Make DragOperation hold a MimeData instance
...instead of maybe bitmap + a single mime type and its corresponding data. This allows drag&drop operations to hold multiple different kinds of data, and the views/applications to choose between those. For instance, Spreadsheet can keep the structure of the dragged cells, and still provide text-only data to be passed to different unrelated editors.
This commit is contained in:
committed by
Andreas Kling
parent
c930e02624
commit
6d1e47e7dd
@@ -307,8 +307,7 @@ void WindowServerConnection::handle(const Messages::WindowClient::AsyncSetWallpa
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DragDropped& message)
|
||||
{
|
||||
if (auto* window = Window::from_window_id(message.window_id())) {
|
||||
auto mime_data = Core::MimeData::construct();
|
||||
mime_data->set_data(message.data_type(), message.data().to_byte_buffer());
|
||||
auto mime_data = Core::MimeData::construct(message.mime_data());
|
||||
Core::EventLoop::current().post_event(*window, make<DropEvent>(message.mouse_position(), message.text(), mime_data));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user