Skip to content

Commit

Permalink
export drag handler
Browse files Browse the repository at this point in the history
  • Loading branch information
L-Super authored and tishion committed Jul 11, 2023
1 parent 52008f1 commit b0f794a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions include/CefViewBrowserClientDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ class CefViewBrowserClientDelegateInterface

// display handler
#pragma region DisplayHandler
virtual bool onDragEnter(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefDragData> dragData,
CefDragHandler::DragOperationsMask mask)
{
return true;
}
virtual void draggableRegionChanged(CefRefPtr<CefBrowser>& browser,
const std::vector<CefDraggableRegion>& regions) = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ CefViewBrowserClient::OnDragEnter(CefRefPtr<CefBrowser> browser,
{
CEF_REQUIRE_UI_THREAD();

// Forbid dragging of URLs and files.
if ((mask & DRAG_OPERATION_LINK) && !dragData->IsFragment()) {
return true;
}
auto delegate = client_delegate_.lock();
if (delegate)
return delegate->onDragEnter(browser, dragData, mask);

return true;
}
Expand Down

0 comments on commit b0f794a

Please sign in to comment.