主动发起拖拽capi的蓝黄同步

Signed-off-by: zhangjinyu101 <zhangjinyu101@huawei.com>
Change-Id: Ic718e41f315b4f39977619f07b9270cf7ff5e5fc
This commit is contained in:
zhangjinyu101 2024-08-12 10:26:36 +08:00
parent 5c617f38ba
commit 89da388a2f
3 changed files with 7 additions and 4 deletions

View File

@ -84,6 +84,7 @@ void GetShadowInfoArray(
void PostStopDrag(std::shared_ptr<OHOS::Ace::NG::ArkUIInteralDragAction> dragAction, const RefPtr<Container>& container)
{
CHECK_NULL_VOID(container);
auto taskExecutor = container->GetTaskExecutor();
CHECK_NULL_VOID(taskExecutor);
auto windowId = container->GetWindowId();
@ -243,7 +244,10 @@ int32_t DragDropFuncWrapper::StartDragAction(std::shared_ptr<OHOS::Ace::NG::ArkU
std::optional<DragDataCore> dragData;
EnvelopedDragData(dragAction, dragData);
if (!dragData) {
manager->GetDragAction()->dragState = DragAdapterState::INIT;
{
std::lock_guard<std::mutex> lock(dragAction->dragStateMutex);
manager->GetDragAction()->dragState = DragAdapterState::INIT;
}
return -1;
}
OnDragCallback callback = [dragAction, manager](const OHOS::Ace::DragNotifyMsg& dragNotifyMsg) {

View File

@ -33,6 +33,8 @@ namespace {
static void DragActionConvert(
ArkUIDragAction* dragAction, std::shared_ptr<OHOS::Ace::NG::ArkUIInteralDragAction> internalDragAction)
{
CHECK_NULL_VOID(dragAction);
CHECK_NULL_VOID(internalDragAction);
internalDragAction->pointer = dragAction->pointerId;
internalDragAction->size = dragAction->size;
internalDragAction->previewOption.isScaleEnabled = dragAction->dragPreviewOption.isScaleEnabled;

View File

@ -283,9 +283,6 @@ ArkUI_DragEvent* OH_ArkUI_DragAndDropInfo_GetDragEvent(ArkUI_DragAndDropInfo* dr
return nullptr;
}
auto* dragAndDropInfos = reinterpret_cast<ArkUIDragAndDropInfo*>(dragAndDropInfo);
if (!dragAndDropInfos) {
return nullptr;
}
return reinterpret_cast<ArkUI_DragEvent*>(dragAndDropInfos->dragEvent);
}