From 1f375ca6663fb11cc41130e8abb7c76e778afda3 Mon Sep 17 00:00:00 2001 From: wangchuan Date: Fri, 22 Aug 2025 11:49:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangchuan --- interfaces/kits/napi/window_runtime/window_napi/js_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 eb71efeef7..ddc13ef7aa 100644 --- a/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp +++ b/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp @@ -4919,7 +4919,7 @@ napi_value JsWindow::OnSetResizeByDragEnabled(napi_env env, napi_callback_info i if (ret == WmErrorCode::WM_OK) { task->Resolve(env, NapiGetUndefined(env)); } else { - task->Reject(env, JsErrUtils::CreateJsError(env, ret)); + task->Reject(env, JsErrUtils::CreateJsError(env, ret,"[window][setResizeByDragEnabled]: Failed")); } TLOGNE(WmsLogTag::WMS_LAYOUT, "%{public}s: Window [%{public}u, %{public}s] set dragEnabled end", where, window->GetWindowId(), window->GetWindowName().c_str()); -- Gitee From 6adb20d1799f2d22df44ae3c3ca10b7664ffe0d5 Mon Sep 17 00:00:00 2001 From: wangchuan Date: Fri, 22 Aug 2025 14:13:58 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=8D=95=E8=AF=8D?= =?UTF-8?q?=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangchuan --- .../napi/window_runtime/window_napi/js_window.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 ddc13ef7aa..221aae6959 100644 --- a/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp +++ b/interfaces/kits/napi/window_runtime/window_napi/js_window.cpp @@ -6776,7 +6776,7 @@ napi_value JsWindow::OnSetAspectRatio(napi_env env, napi_callback_info info) if (errCode == WMError::WM_ERROR_INVALID_PARAM || aspectRatio <= 0.0) { return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_PARAM, - "[window][setAspectRatio]msg: Falied"); + "[window][setAspectRatio]msg: failed"); } napi_value lastParam = (argc == 1) ? nullptr : (GetType(env, argv[1]) == napi_function ? argv[1] : nullptr); @@ -6787,7 +6787,7 @@ napi_value JsWindow::OnSetAspectRatio(napi_env env, napi_callback_info info) auto window = weakToken.promote(); if (window == nullptr) { task->Reject(env, JsErrUtils::CreateJsError(env, WmErrorCode::WM_ERROR_STATE_ABNORMALLY, - "[window][setAspectRatio]msg: Falied")); + "[window][setAspectRatio]msg: failed")); return; } WMError ret = window->SetAspectRatio(aspectRatio); @@ -6795,7 +6795,7 @@ napi_value JsWindow::OnSetAspectRatio(napi_env env, napi_callback_info info) task->Resolve(env, NapiGetUndefined(env)); } else { task->Reject(env, JsErrUtils::CreateJsError(env, WM_JS_TO_ERROR_CODE_MAP.at(ret), - "[window][setAspectRatio]msg: Falied")); + "[window][setAspectRatio]msg: failed")); } TLOGNI(WmsLogTag::WMS_LAYOUT, "%{public}s: end, window [%{public}u, %{public}s] ret=%{public}d", where, window->GetWindowId(), window->GetWindowName().c_str(), ret); @@ -6803,7 +6803,7 @@ napi_value JsWindow::OnSetAspectRatio(napi_env env, napi_callback_info info) if (napi_send_event(env, asyncTask, napi_eprio_high, "OnSetAspectRatio") != napi_status::napi_ok) { napiAsyncTask->Reject(env, JsErrUtils::CreateJsError(env, WmErrorCode::WM_ERROR_STATE_ABNORMALLY, - "[window][setAspectRatio]msg: Falied")); + "[window][setAspectRatio]msg: failed")); } return result; } @@ -7225,7 +7225,7 @@ napi_value JsWindow::OnGetWindowLimits(napi_env env, napi_callback_info info) WindowLimits windowLimits; WmErrorCode ret = WM_JS_TO_ERROR_CODE_MAP.at(windowToken_->GetWindowLimits(windowLimits)); if (ret != WmErrorCode::WM_OK) { - return NapiThrowError(env, ret, "[window][getWindowLimits]msg: Falied"); + return NapiThrowError(env, ret, "[window][getWindowLimits]msg: failed"); } auto objValue = GetWindowLimitsAndConvertToJsValue(env, windowLimits); TLOGI(WmsLogTag::WMS_LAYOUT, "Window [%{public}u, %{public}s] get window limits end", @@ -8137,7 +8137,7 @@ napi_value JsWindow::OnGetWindowStatus(napi_env env, napi_callback_info info) if (ret != WmErrorCode::WM_OK) { TLOGE(WmsLogTag::WMS_PC, "failed, ret=%{public}d", ret); return NapiThrowError(env, ret, - "[window][getWindowStatus]msg: Falied"); + "[window][getWindowStatus]msg: failed"); } auto objValue = CreateJsValue(env, windowStatus); if (objValue != nullptr) { @@ -8969,7 +8969,7 @@ napi_value JsWindow::OnSetFollowParentWindowLayoutEnabled(napi_env env, napi_cal if (!ConvertFromJsValue(env, argv[INDEX_ZERO], isFollow)) { TLOGE(WmsLogTag::WMS_SUB, "Failed to convert parameter to enable"); return NapiThrowError(env, WmErrorCode::WM_ERROR_INVALID_PARAM, - "[window][setFollowParentWindowLayoutEnabled]msg: Falied to convert parameter to enable"); + "[window][setFollowParentWindowLayoutEnabled]msg: failed to convert parameter to enable"); } std::shared_ptr errCodePtr = std::make_shared(WmErrorCode::WM_OK); const char* const where = __func__; -- Gitee From 2ab1ed6352d2df5db37c4ea1082f2da9488bee63 Mon Sep 17 00:00:00 2001 From: wangchuan Date: Thu, 28 Aug 2025 11:37:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9=E4=BB=A5=E5=8F=8A=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E6=9E=9A=E4=B8=BE=E5=80=BC=E7=9A=84=E5=90=88=E6=B3=95?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangchuan --- window_scene/session/host/src/move_drag_controller.cpp | 2 +- wmserver/src/zidl/window_manager_stub.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/window_scene/session/host/src/move_drag_controller.cpp b/window_scene/session/host/src/move_drag_controller.cpp index c49e516def..758f8502d9 100644 --- a/window_scene/session/host/src/move_drag_controller.cpp +++ b/window_scene/session/host/src/move_drag_controller.cpp @@ -1022,7 +1022,7 @@ bool MoveDragController::EventDownInit(const std::shared_ptr& moveDragProperty_.originalRect_); dragAreaType_ = SessionHelper::GetAreaTypeForScaleResize(pointerItem.GetWindowX(), pointerItem.GetWindowY(), outside, moveDragProperty_.originalRect_); - TLOGI(WmsLogTag::WMS_LAYOUT, "pointWinX:%{public}d, pointWinY:%{public}d, outside:%{public}d, vpr:%{public}f, " + TLOGI(WmsLogTag::WMS_LAYOUT, "pointWinX:%{private}d, pointWinY:%{private}d, outside:%{public}d, vpr:%{public}f, " "rect:%{public}s, type:%{public}d", pointerItem.GetWindowX(), pointerItem.GetWindowY(), outside, vpr_, moveDragProperty_.originalRect_.ToString().c_str(), type_); if (type_ == AreaType::UNDEFINED) { diff --git a/wmserver/src/zidl/window_manager_stub.cpp b/wmserver/src/zidl/window_manager_stub.cpp index 7219ddd877..001ba1758d 100644 --- a/wmserver/src/zidl/window_manager_stub.cpp +++ b/wmserver/src/zidl/window_manager_stub.cpp @@ -216,7 +216,7 @@ int32_t WindowManagerStub::OnRemoteRequest(uint32_t code, MessageParcel& data, M } case WindowManagerMessage::TRANS_ID_UPDATE_LAYOUT_MODE: { uint32_t layoutMode = 0; - if (!data.ReadUint32(layoutMode)) { + if (!data.ReadUint32(layoutMode) || layoutMode >= static_cast(WindowLayoutMode::END)) { TLOGE(WmsLogTag::WMS_LAYOUT, "read layoutMode failed"); return ERR_INVALID_DATA; } -- Gitee