Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image preview while dragging in CEF client

I'm using cefclient in Unreal Engine. When you drag any image in the normal chrome browser, it will give preview of image. enter image description here

But, when I tried to do the same in cefclient, it didn't work. So I tried downloading the cefclient executable and do the same. But it's giving alert like below..

enter image description here

Anyone knows how to fix this?

like image 562
Dipen Dedania Avatar asked Jun 22 '26 15:06

Dipen Dedania


1 Answers

Download CEF/cefclient sources and find the given text:

  // Forbid dragging of URLs and files.
  if ((mask & DRAG_OPERATION_LINK) && !dragData->IsFragment()) {
    test_runner::Alert(browser, "cefclient blocks dragging of URLs and files");
    return true;
  }

Searching for "chromiumembedded DRAG_OPERATION_LINK" gives you this comment:

The drag is blocked in cefclient\browser\client_handler.cc ClientHandler::OnDragEnter():
  // Forbid dragging of link URLs.
  if (mask & DRAG_OPERATION_LINK)
    return true;
Howevever, it appears that this check is wrong in current CEF versions since |mask| is DRAG_OPERATION_COPY | DRAG_OPERATION_LINK | DRAG_OPERATION_MOVE when dragging both links and fragments.
The check should be fixed to properly differentiate between links and fragments.
For your purposes you can remove this check and all dragging operations will work in cefclient.

https://bitbucket.org/chromiumembedded/cef/issues/1885/drag-and-drop-of-selected-text-in-input#comment-27661218

like image 176
Czarek Tomczak Avatar answered Jun 25 '26 05:06

Czarek Tomczak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!