UI/AppKit: Process drag-and-drop events through the web view

This forwards all drag-and-drop events from the UI to the WebContent
process. If the page accepts the events, the UI does not handle them.
Otherwise, we will open the dropped files as file:// URLs.
This commit is contained in:
Timothy Flynn 2024-08-17 16:23:13 -04:00 committed by Andreas Kling
parent 948b6de3b1
commit ac062d0c97
Notes: github-actions[bot] 2024-08-19 11:30:14 +00:00
5 changed files with 138 additions and 3 deletions

View file

@ -93,6 +93,13 @@ void WebViewBridge::enqueue_input_event(Web::MouseEvent event)
ViewImplementation::enqueue_input_event(move(event));
}
void WebViewBridge::enqueue_input_event(Web::DragEvent event)
{
event.position = to_content_position(event.position.to_type<int>()).to_type<Web::DevicePixels>();
event.screen_position = to_content_position(event.screen_position.to_type<int>()).to_type<Web::DevicePixels>();
ViewImplementation::enqueue_input_event(move(event));
}
void WebViewBridge::enqueue_input_event(Web::KeyEvent event)
{
ViewImplementation::enqueue_input_event(move(event));