compatible mode drag

Change-Id: I1cce0e1b5a09ec76c9de2a2e3feb1981fc51d95a
Signed-off-by: majian <majian59@huawei.com>
This commit is contained in:
majian 2024-11-22 17:06:28 +08:00
parent 750556dc70
commit 1156cb6610

View File

@ -2575,7 +2575,9 @@ void SceneSession::HandleCompatibleModeDrag(WSRect& rect, SizeChangeReason reaso
const int32_t compatibleInPcLandscapeWidth = sessionProperty->GetCompatibleInPcLandscapeWidth(); const int32_t compatibleInPcLandscapeWidth = sessionProperty->GetCompatibleInPcLandscapeWidth();
const int32_t compatibleInPcLandscapeHeight = sessionProperty->GetCompatibleInPcLandscapeHeight(); const int32_t compatibleInPcLandscapeHeight = sessionProperty->GetCompatibleInPcLandscapeHeight();
const int32_t compatibleInPcDragLimit = compatibleInPcLandscapeWidth - compatibleInPcPortraitWidth; const int32_t compatibleInPcDragLimit = compatibleInPcLandscapeWidth - compatibleInPcPortraitWidth;
WSRect windowRect = GetSessionRect(); WSRect windowRect = moveDragController_->GetTargetRect(reason == SizeChangeReason::DRAG_END ?
MoveDragController::TargetRectCoordinate::RELATED_TO_END_DISPLAY :
MoveDragController::TargetRectCoordinate::GLOBAL);
auto windowWidth = windowRect.width_; auto windowWidth = windowRect.width_;
auto windowHeight = windowRect.height_; auto windowHeight = windowRect.height_;
@ -2794,7 +2796,11 @@ void SceneSession::OnMoveDragCallback(SizeChangeReason reason)
HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER, HITRACE_METER_FMT(HITRACE_TAG_WINDOW_MANAGER,
"SceneSession::OnMoveDragCallback [%d, %d, %u, %u]", rect.posX_, rect.posY_, rect.width_, rect.height_); "SceneSession::OnMoveDragCallback [%d, %d, %u, %u]", rect.posX_, rect.posY_, rect.width_, rect.height_);
if (isCompatibleModeInPc && !IsFreeMultiWindowMode()) { if (isCompatibleModeInPc && !IsFreeMultiWindowMode()) {
if (reason == SizeChangeReason::DRAG_END) {
HandleCompatibleModeMoveDrag(rect, reason, isSupportDragInPcCompatibleMode, isGlobal, needFlush);
} else {
HandleCompatibleModeMoveDrag(globalRect, reason, isSupportDragInPcCompatibleMode, isGlobal, needFlush); HandleCompatibleModeMoveDrag(globalRect, reason, isSupportDragInPcCompatibleMode, isGlobal, needFlush);
}
} else if (reason == SizeChangeReason::DRAG && IsFreeMultiWindowMode() && isMainWindow) { } else if (reason == SizeChangeReason::DRAG && IsFreeMultiWindowMode() && isMainWindow) {
OnSessionEvent(SessionEvent::EVENT_DRAG); OnSessionEvent(SessionEvent::EVENT_DRAG);
return; return;