mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-12 02:30:30 +09:00
LibGUI: Port the drag&drop code to Core::MimeData
This commit is contained in:
parent
3cba9c3c25
commit
814d59f462
Notes:
sideshowbarker
2024-07-19 09:20:38 +09:00
Author: https://github.com/awesomekling
Commit: 814d59f462
10 changed files with 59 additions and 53 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <LibCore/MimeData.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
|
@ -309,8 +310,11 @@ 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()))
|
||||
Core::EventLoop::current().post_event(*window, make<DropEvent>(message.mouse_position(), message.text(), message.data_type(), message.data()));
|
||||
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());
|
||||
Core::EventLoop::current().post_event(*window, make<DropEvent>(message.mouse_position(), message.text(), mime_data));
|
||||
}
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::DragAccepted&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue