【问题标题】:Image preview while dragging in CEF client在 CEF 客户端中拖动时的图像预览
【发布时间】:2017-07-27 10:01:08
【问题描述】:

我在虚幻引擎中使用 cefclient。当您在普通 chrome 浏览器中拖动任何图像时,它将提供图像预览。

但是,当我尝试在 cefclient 中做同样的事情时,它不起作用。所以我尝试下载cefclient 可执行文件并执行相同操作。但它会发出如下警报..

有人知道如何解决这个问题吗?

【问题讨论】:

  • 这个问题解决了吗?我遇到了这个问题,似乎找不到任何解决方案。

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


【解决方案1】:

下载 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-09-11
    • 2017-11-20
    • 2014-08-14
    • 1970-01-01
    • 2011-10-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多