在CEF客户端

时间:2017-07-27 10:01:09

标签: c++ image google-chrome chromium-embedded

我在虚幻引擎中使用cefclient。在普通的Chrome浏览器中拖动任何图像时,它将提供图像预览。 enter image description here

但是,当我尝试在cefclient中做同样的事情时,它没有用。所以我尝试下载cefclient可执行文件并执行相同的操作。但它正在给出如下警告..

enter image description here

任何人都知道如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

下载CEF / cefclient来源并找到给定的文字:

  // 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;
  }

搜索"chromiumembedded DRAG_OPERATION_LINK"会为您提供以下评论:

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