diff --git a/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp b/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp index bf783a9d9b06e44b8b1f922dacda91ade1cbfa1e..5bbbb8ce18bff085c8521b2de7908b61189f0830 100644 --- a/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp +++ b/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp @@ -6989,7 +6989,8 @@ napi_value JsWindow::OnMaximize(napi_env env, napi_callback_info info) (GetType(env, argv[INDEX_ONE]) == napi_function ? argv[INDEX_ONE] : nullptr); napi_value result = nullptr; std::shared_ptr napiAsyncTask = CreateEmptyAsyncTask(env, lastParam, &result); - auto asyncTask = [windowToken = wptr(windowToken_), presentation, env, task = napiAsyncTask] { + const char* const where = __func__; + auto asyncTask = [windowToken = wptr(windowToken_), presentation, env, where, task = napiAsyncTask] { auto window = windowToken.promote(); if (window == nullptr) { task->Reject(env, @@ -7005,6 +7006,8 @@ napi_value JsWindow::OnMaximize(napi_env env, napi_callback_info info) task->Reject(env, JsErrUtils::CreateJsError(env, wmErrorCode, "[window][maximize]msg: Failed")); } + TLOGNI(WmsLogTag::WMS_PC, "%{public}s id:%{public}u presentation:%{public}d end, ret=%{public}d", + where, window->GetWindowId(), static_cast(presentation), ret); }; if (napi_send_event(env, asyncTask, napi_eprio_immediate, "OnMaximize") != napi_status::napi_ok) { napiAsyncTask->Reject(env, CreateJsError(env, diff --git a/window_scene/session/host/src/main_session.cpp b/window_scene/session/host/src/main_session.cpp index 221fbc14b4aa4808ebfafa35c5620de2ad77ac1d..2cbd7c4a7b5d484c7410715ead98cdc36f47e619 100644 --- a/window_scene/session/host/src/main_session.cpp +++ b/window_scene/session/host/src/main_session.cpp @@ -378,13 +378,18 @@ void MainSession::NotifySubAndDialogFollowRectChange(const WSRect& rect, bool is funcMap = notifySurfaceBoundsChangeFuncMap_; } WSRect newRect; + bool isCompatMode = IsInCompatScaleMode(); for (const auto& [sessionId, func] : funcMap) { auto subSession = GetSceneSessionById(sessionId); if (subSession && subSession->GetIsFollowParentLayout() && func) { - if (newRect.IsEmpty()) { - HookStartMoveRect(newRect, rect); + if (isCompatMode && GetCallingPid() != subSession->GetCallingPid()) { + if (newRect.IsEmpty()) { + HookStartMoveRect(newRect, rect); + } + func(newRect, isGlobal, needFlush); + } else { + func(rect, isGlobal, needFlush); } - func(newRect, isGlobal, needFlush); } } } diff --git a/wm/src/window_scene_session_impl.cpp b/wm/src/window_scene_session_impl.cpp index cf31a7e89a6432a799dc49c4d4d91fb5e5d0cc6e..44696d131e5cc3b108b6baa769c06d4b9ae6ec16 100644 --- a/wm/src/window_scene_session_impl.cpp +++ b/wm/src/window_scene_session_impl.cpp @@ -5863,6 +5863,11 @@ WMError WindowSceneSessionImpl::SetDefaultDensityEnabled(bool enabled) return WMError::WM_OK; } + if (property_->IsAdaptToSimulationScale()) { + TLOGI(WmsLogTag::WMS_COMPAT, "compat mode not use default density"); + return WMError::WM_OK; + } + if (auto hostSession = GetHostSession()) { hostSession->OnDefaultDensityEnabled(enabled); } @@ -6724,6 +6729,7 @@ WMError WindowSceneSessionImpl::SetFollowParentWindowLayoutEnabled(bool isFollow return WMError::WM_ERROR_INVALID_SESSION; } WSError ret = GetHostSession()->SetFollowParentWindowLayoutEnabled(isFollow); + TLOGI(WmsLogTag::WMS_SUB, "id:%{public}d, isFollow:%{public}d", GetPersistentId(), isFollow); if (ret == WSError::WS_ERROR_DEVICE_NOT_SUPPORT) { return WMError::WM_ERROR_DEVICE_NOT_SUPPORT; }