From 0c03fdd04a1a8f688426c0c2426d8f804ea66410 Mon Sep 17 00:00:00 2001 From: hexu28huawei <14530909+hexu28huawei@user.noreply.gitee.com> Date: Tue, 31 Dec 2024 17:19:12 +0800 Subject: [PATCH] fix drag end gray Signed-off-by: hexu28huawei Change-Id: I1ee5fa26879e937822aea79ecccc86c60558c85b --- ohos_nweb/src/cef_delegate/nweb_render_handler.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ohos_nweb/src/cef_delegate/nweb_render_handler.cc b/ohos_nweb/src/cef_delegate/nweb_render_handler.cc index 7088277620..5e903635dd 100644 --- a/ohos_nweb/src/cef_delegate/nweb_render_handler.cc +++ b/ohos_nweb/src/cef_delegate/nweb_render_handler.cc @@ -31,6 +31,7 @@ #ifdef OHOS_DRAG_DROP #include "base/files/file_path.h" #include "base/files/file_util.h" +#include "base/ohos/sys_info_utils.h" #include "cef/libcef/common/drag_data_impl.h" #include "content/public/common/drop_data.h" #if defined(REPORT_SYS_EVENT) @@ -928,9 +929,13 @@ bool NWebRenderHandler::StartDragging(CefRefPtr browser, } #endif + bool is_drag_new_style = true; + if (base::ohos::IsTabletDevice() || base::ohos::IsPcDevice()) { + is_drag_new_style = false; + } nweb_drag_data_ = std::make_shared( drag_data, drag_touch_point, start_edge, end_edge, - screen_info_.display_ratio, usefull_selection, dark_mode_enable, view_port_height, true); + screen_info_.display_ratio, usefull_selection, dark_mode_enable, view_port_height, is_drag_new_style); auto handler = handler_.lock(); if (handler == nullptr) { -- Gitee