chrome: Add CefDragHandler::OnDragEnter support
On Windows, in CEF version 136 and 137 CefDragHandler::OnDragEnter is never being called when a file is dragged to an HTML page, which handles Drag-and-Drop.
To Reproduce Steps to reproduce the behavior:
- Add these lines to simple_handler.h in cefsimple:
CefRefPtr<CefDragHandler> GetDragHandler() override { return this; }
virtual bool OnDragEnter(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDragData> dragData,
DragOperationsMask mask)
{
::MessageBox(NULL, L"!!!!!!", L"!!!!!!", 0);
return true;
}
- I will attach html test pages, which can be used to verify this behavior.
Expected behavior When a files is being dragged onto an area which handles DnD, OnDragEnter should be called
Versions (please complete the following information):
- OS: Windows 11
- CEF Version: 136., 137.
Additional context Does the problem reproduce with the cefclient or cefsimple sample application at the same version?
Yes, easily reproducible. I will attach html test pages As an additional context, I build with sandbox disabled.
Chrome style does not currently intercept Browser::CanDragEnter to override default drag event handling.
Testing with M138 and dragging an HTML file from Windows Explorer into the browser content area:
- ClientHandler::OnDragEnter is called for Alloy style (
cefclient --use-alloy-style) - ClientHandler::OnOpenURLFromTab is called for Chrome style, with target_disposition=CEF_WOD_NEW_FOREGROUND_TAB and user_gesture=true