From f1fd8854805a5d394a001769c3b3e86b6a89e8a6 Mon Sep 17 00:00:00 2001 From: Laiganlu Date: Sat, 6 Sep 2025 14:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=98=E5=8F=A0=E5=9B=BA=E5=AE=9A=E6=97=8B?= =?UTF-8?q?=E8=BD=AC=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Laiganlu --- window_scene/session/host/src/session.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/window_scene/session/host/src/session.cpp b/window_scene/session/host/src/session.cpp index 70d6f6d9f4..cbdd799d1d 100644 --- a/window_scene/session/host/src/session.cpp +++ b/window_scene/session/host/src/session.cpp @@ -29,6 +29,7 @@ #include "proxy/include/window_info.h" #include "common/include/session_permission.h" +#include "fold_screen_state_internel.h" #include "rs_adapter.h" #include "session_coordinate_helper.h" #include "session_helper.h" @@ -75,6 +76,7 @@ const std::map DETACH_MAP = { { SessionState::STATE_INACTIVE, true }, { SessionState::STATE_BACKGROUND, true }, }; +const uint32_t ROTATION_LANDSCAPE_INVERTED = 3; } // namespace std::shared_ptr Session::mainHandler_; @@ -2750,7 +2752,12 @@ void Session::SaveSnapshot(bool useFfrt, bool needPersist, std::shared_ptrGetScreenStatus() == SCREEN_FOLDED) { + rotation = ROTATION_LANDSCAPE_INVERTED; + } + auto rotate = WSSnapshotHelper::GetDisplayOrientation(rotation); if (persistentPixelMap) { key = defaultStatus; rotate = DisplayOrientation::PORTRAIT; @@ -2944,6 +2951,10 @@ SnapshotStatus Session::GetSessionSnapshotStatus(BackgroundReason reason) const snapshotScreen = SCREEN_EXPAND; } uint32_t orientation = WSSnapshotHelper::GetOrientation(currentRotation_); + if (FoldScreenStateInternel::IsSingleDisplayPocketFoldDevice() && + WSSnapshotHelper::GetInstance()->GetScreenStatus() == SCREEN_FOLDED) { + orientation = 1; + } return std::make_pair(snapshotScreen, orientation); } @@ -2960,6 +2971,10 @@ uint32_t Session::GetLastOrientation() const if (!SupportSnapshotAllSessionStatus()) { return SNAPSHOT_PORTRAIT; } + if (FoldScreenStateInternel::IsSingleDisplayPocketFoldDevice() && + WSSnapshotHelper::GetInstance()->GetScreenStatus() == SCREEN_FOLDED) { + return ROTATION_LANDSCAPE_INVERTED; + } return static_cast(WSSnapshotHelper::GetDisplayOrientation(currentRotation_)); } -- Gitee